Skip to content

Commit

Permalink
Fix for Mac window title and controls corruption which was caused by …
Browse files Browse the repository at this point in the history
…an integer overflow when calculating an empty panning rectangle.

git-svn-id: http://svn.osgeo.org/qgis/trunk@6471 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Jan 29, 2007
1 parent 5fc6b6f commit 7bd9622
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gui/qgsmapoverviewcanvas.cpp
Original file line number Diff line number Diff line change
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 7bd9622

Please sign in to comment.