Changeset View
Changeset View
Standalone View
Standalone View
views/kpUnzoomedThumbnailView.cpp
Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Line(s) | 105 | qCDebug(kpLogViews) << "kpUnzoomedThumbnailView(" << name () | |||
---|---|---|---|---|---|
112 | << endl; | 112 | << endl; | ||
113 | #endif | 113 | #endif | ||
114 | 114 | | |||
115 | 115 | | |||
116 | #if 1 | 116 | #if 1 | ||
117 | int x; | 117 | int x; | ||
118 | if (document ()->width () > width ()) | 118 | if (document ()->width () > width ()) | ||
119 | { | 119 | { | ||
120 | x = (int) buddyView ()->transformViewToDocX (scrollViewContentsX); | 120 | x = static_cast<int> (buddyView ()->transformViewToDocX (scrollViewContentsX)); | ||
121 | const int rightMostAllowedX = qMax (0, document ()->width () - width ()); | 121 | const int rightMostAllowedX = qMax (0, document ()->width () - width ()); | ||
122 | #if DEBUG_KP_UNZOOMED_THUMBNAIL_VIEW | 122 | #if DEBUG_KP_UNZOOMED_THUMBNAIL_VIEW | ||
123 | qCDebug(kpLogViews) << "\tdocX=" << x | 123 | qCDebug(kpLogViews) << "\tdocX=" << x | ||
124 | << " docWidth=" << document ()->width () | 124 | << " docWidth=" << document ()->width () | ||
125 | << " rightMostAllowedX=" << rightMostAllowedX | 125 | << " rightMostAllowedX=" << rightMostAllowedX | ||
126 | << endl; | 126 | << endl; | ||
127 | #endif | 127 | #endif | ||
128 | if (x > rightMostAllowedX) | 128 | if (x > rightMostAllowedX) | ||
129 | x = rightMostAllowedX; | 129 | x = rightMostAllowedX; | ||
130 | } | 130 | } | ||
131 | // Thumbnail width <= doc width | 131 | // Thumbnail width <= doc width | ||
132 | else | 132 | else | ||
133 | { | 133 | { | ||
134 | // Center X (rather than flush left to be consistent with | 134 | // Center X (rather than flush left to be consistent with | ||
135 | // kpZoomedThumbnailView) | 135 | // kpZoomedThumbnailView) | ||
136 | x = -(width () - document ()->width ()) / 2; | 136 | x = -(width () - document ()->width ()) / 2; | ||
137 | } | 137 | } | ||
138 | 138 | | |||
139 | 139 | | |||
140 | int y; | 140 | int y; | ||
141 | if (document ()->height () > height ()) | 141 | if (document ()->height () > height ()) | ||
142 | { | 142 | { | ||
143 | y = (int) buddyView ()->transformViewToDocY (scrollViewContentsY); | 143 | y = static_cast<int> (buddyView ()->transformViewToDocY (scrollViewContentsY)); | ||
144 | const int bottomMostAllowedY = qMax (0, document ()->height () - height ()); | 144 | const int bottomMostAllowedY = qMax (0, document ()->height () - height ()); | ||
145 | #if DEBUG_KP_UNZOOMED_THUMBNAIL_VIEW | 145 | #if DEBUG_KP_UNZOOMED_THUMBNAIL_VIEW | ||
146 | qCDebug(kpLogViews) << "\tdocY=" << y | 146 | qCDebug(kpLogViews) << "\tdocY=" << y | ||
147 | << " docHeight=" << document ()->height () | 147 | << " docHeight=" << document ()->height () | ||
148 | << " bottomMostAllowedY=" << bottomMostAllowedY | 148 | << " bottomMostAllowedY=" << bottomMostAllowedY | ||
149 | << endl; | 149 | << endl; | ||
150 | #endif | 150 | #endif | ||
151 | if (y > bottomMostAllowedY) | 151 | if (y > bottomMostAllowedY) | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |