Skip to content

Commit ef2b1d3

Browse files
author
telwertowski
committedFeb 8, 2007
Fix for Mac window title and controls corruption which was caused by an integer overflow when calculating an empty panning rectangle. (same as r6471 in trunk)
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6550 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent bb2d8c3 commit ef2b1d3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/gui/qgsmapoverviewcanvas.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ void QgsMapOverviewCanvas::reflectChangedExtent()
136136
if (y1 > y2)
137137
std::swap(y1, y2);
138138

139+
#ifdef Q_WS_MAC
140+
// setGeometry (Qt 4.2) is causing Mac window corruption (decorations
141+
// are drawn at odd locations) if both coords are at limit. This may
142+
// have something to do with Qt calculating dimensions as x2 - x1 + 1.
143+
// (INT_MAX - INT_MIN + 1 is UINT_MAX + 1)
144+
if (x1 == INT_MIN && x2 == INT_MAX) x1 += 1; // x2 -= 1 works too
145+
if (y1 == INT_MIN && y2 == INT_MAX) y1 += 1;
146+
#endif
147+
139148
QRect r(x1, y1, x2-x1+1, y2-y1+1);
140149

141150
#ifdef QGISDEBUG

0 commit comments

Comments
 (0)
Please sign in to comment.