Changeset View
Changeset View
Standalone View
Standalone View
views/kpZoomedView.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 48 | : kpView (document, toolToolBar, viewManager, | |||
---|---|---|---|---|---|
49 | buddyView, | 49 | buddyView, | ||
50 | scrollableContainer, | 50 | scrollableContainer, | ||
51 | parent) | 51 | parent) | ||
52 | { | 52 | { | ||
53 | // Call to virtual function - this is why the class is sealed | 53 | // Call to virtual function - this is why the class is sealed | ||
54 | adjustToEnvironment (); | 54 | adjustToEnvironment (); | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | kpZoomedView::~kpZoomedView () | 57 | kpZoomedView::~kpZoomedView () = default; | ||
58 | { | | |||
59 | } | | |||
60 | 58 | | |||
61 | 59 | | |||
62 | // public virtual [base kpView] | 60 | // public virtual [base kpView] | ||
63 | void kpZoomedView::setZoomLevel (int hzoom, int vzoom) | 61 | void kpZoomedView::setZoomLevel (int hzoom, int vzoom) | ||
64 | { | 62 | { | ||
65 | if (viewManager ()) | 63 | if (viewManager ()) { | ||
66 | viewManager ()->setQueueUpdates (); | 64 | viewManager ()->setQueueUpdates (); | ||
65 | } | ||||
67 | 66 | | |||
68 | { | 67 | { | ||
69 | kpView::setZoomLevel (hzoom, vzoom); | 68 | kpView::setZoomLevel (hzoom, vzoom); | ||
70 | 69 | | |||
71 | adjustToEnvironment (); | 70 | adjustToEnvironment (); | ||
72 | } | 71 | } | ||
73 | 72 | | |||
74 | if (viewManager ()) | 73 | if (viewManager ()) { | ||
75 | viewManager ()->restoreQueueUpdates (); | 74 | viewManager ()->restoreQueueUpdates (); | ||
76 | } | 75 | } | ||
76 | } | ||||
77 | 77 | | |||
78 | 78 | | |||
79 | // public slot virtual [base kpView] | 79 | // public slot virtual [base kpView] | ||
80 | void kpZoomedView::adjustToEnvironment () | 80 | void kpZoomedView::adjustToEnvironment () | ||
81 | { | 81 | { | ||
82 | if (document ()) | 82 | if (document ()) | ||
83 | { | 83 | { | ||
84 | // TODO: use zoomedDocWidth() & zoomedDocHeight()? | 84 | // TODO: use zoomedDocWidth() & zoomedDocHeight()? | ||
85 | resize (static_cast<int> (transformDocToViewX (document ()->width ())), | 85 | resize (static_cast<int> (transformDocToViewX (document ()->width ())), | ||
86 | static_cast<int> (transformDocToViewY (document ()->height ()))); | 86 | static_cast<int> (transformDocToViewY (document ()->height ()))); | ||
87 | } | 87 | } | ||
88 | } | 88 | } | ||
89 | 89 | | |||
90 | 90 | |