Skip to content

Commit 7bd9622

Browse files
author
telwertowski
committedJan 29, 2007
Fix for Mac window title and controls corruption which was caused by an integer overflow when calculating an empty panning rectangle.
git-svn-id: http://svn.osgeo.org/qgis/trunk@6471 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 5fc6b6f commit 7bd9622

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.