Mercurial > hg > easyhg
comparison panned.cpp @ 132:16ceeee30e2a
* Ensure panned rect stays current when size changes; update panner cache when scene changes
author | Chris Cannam |
---|---|
date | Tue, 30 Nov 2010 11:41:46 +0000 |
parents | 2550aaa09240 |
children | aaeab914f2a3 |
comparison
equal
deleted
inserted
replaced
131:2550aaa09240 | 132:16ceeee30e2a |
---|---|
37 QPointF nearpt = mapToScene(0, 0); | 37 QPointF nearpt = mapToScene(0, 0); |
38 QPointF farpt = mapToScene(width(), height()); | 38 QPointF farpt = mapToScene(width(), height()); |
39 QSizeF sz(farpt.x()-nearpt.x(), farpt.y()-nearpt.y()); | 39 QSizeF sz(farpt.x()-nearpt.x(), farpt.y()-nearpt.y()); |
40 QRectF pr(nearpt, sz); | 40 QRectF pr(nearpt, sz); |
41 | 41 |
42 QGraphicsView::resizeEvent(ev); | |
43 | |
42 if (pr != m_pannedRect) { | 44 if (pr != m_pannedRect) { |
45 DEBUG << "Panned: setting panned rect to " << pr << endl; | |
43 m_pannedRect = pr; | 46 m_pannedRect = pr; |
44 emit pannedRectChanged(pr); | 47 emit pannedRectChanged(pr); |
45 } | 48 } |
46 | |
47 QGraphicsView::resizeEvent(ev); | |
48 } | 49 } |
49 | 50 |
50 void | 51 void |
51 Panned::paintEvent(QPaintEvent *e) | 52 Panned::paintEvent(QPaintEvent *e) |
52 { | 53 { |