Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
telwertowski committed Feb 8, 2007
1 parent bb2d8c3 commit ef2b1d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gui/qgsmapoverviewcanvas.cpp
Expand Up @@ -136,6 +136,15 @@ void QgsMapOverviewCanvas::reflectChangedExtent()
if (y1 > y2)
std::swap(y1, y2);

#ifdef Q_WS_MAC
// setGeometry (Qt 4.2) is causing Mac window corruption (decorations
// are drawn at odd locations) if both coords are at limit. This may
// have something to do with Qt calculating dimensions as x2 - x1 + 1.
// (INT_MAX - INT_MIN + 1 is UINT_MAX + 1)
if (x1 == INT_MIN && x2 == INT_MAX) x1 += 1; // x2 -= 1 works too
if (y1 == INT_MIN && y2 == INT_MAX) y1 += 1;
#endif

QRect r(x1, y1, x2-x1+1, y2-y1+1);

#ifdef QGISDEBUG
Expand Down

0 comments on commit ef2b1d3

Please sign in to comment.