diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-04-28 01:45:35 -0400 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-04-28 01:45:35 -0400 |
| commit | 97c8f1182a3bc40e9c28c9987a4361748bf140e7 (patch) | |
| tree | 0340768557d3c979f761c21825222afd37b65d43 /sigmodr/widgets | |
| parent | e223b742f062f795959800f4d605dbb8d3e4dee8 (diff) | |
| download | sigen-97c8f1182a3bc40e9c28c9987a4361748bf140e7.tar.gz sigen-97c8f1182a3bc40e9c28c9987a4361748bf140e7.tar.xz sigen-97c8f1182a3bc40e9c28c9987a4361748bf140e7.zip | |
Add case for when rect2 is null
Diffstat (limited to 'sigmodr/widgets')
| -rw-r--r-- | sigmodr/widgets/mapeditor/WorldMapPlacement.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp b/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp index 2ebf68b4..f316bcbc 100644 --- a/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp +++ b/sigmodr/widgets/mapeditor/WorldMapPlacement.cpp @@ -240,6 +240,8 @@ static const QRect& closer(const QRect& rect1, const QRect& rect2, const QPoint& { if (rect1.isNull()) return rect2; + if (rect2.isNull()) + return rect1; const QPoint rect1Point = rect1.center() - point; const QPoint rect2Point = rect2.center() - point; const int rect1Dist = pow(rect1Point.x(), 2) + pow(rect1Point.y(), 2); |
