Skip to content
Permalink
Browse files

Fix #10524 (fix zoom to full)

  • Loading branch information
wonder-sk committed Jun 10, 2014
1 parent 7f30ad2 commit 3af01b345c8ae16ca29fa8d86c63857484541736
Showing with 8 additions and 3 deletions.
  1. +2 −1 python/core/qgsrectangle.sip
  2. +4 −1 src/core/qgsrectangle.cpp
  3. +2 −1 src/core/qgsrectangle.h
@@ -79,7 +79,8 @@ class QgsRectangle
//! test if rectangle is empty
//! Empty rectangle may still be non-null if it contains valid information (e.g. bounding box of a point)
bool isEmpty() const;
//! test if the rectangle has all coordinates zero. Null rectangle is also an empty rectangle.
//! test if the rectangle is null (all coordinates zero or after call to setMinimal()).
//! Null rectangle is also an empty rectangle.
//! @note added in 2.4
bool isNull() const;
//! returns string representation in Wkt form
@@ -196,7 +196,10 @@ bool QgsRectangle::isEmpty() const

bool QgsRectangle::isNull() const
{
return xmin == 0 && xmax == 0 && ymin == 0 && ymax == 0;
// rectangle created QgsRectangle() or with rect.setMinimal() ?
return ( xmin == 0 && xmax == 0 && ymin == 0 && ymax == 0 ) ||
( xmin == std::numeric_limits<double>::max() && ymin == std::numeric_limits<double>::max() &&
xmax == -std::numeric_limits<double>::max() && ymax == -std::numeric_limits<double>::max() );
}

QString QgsRectangle::asWktCoordinates() const
@@ -102,7 +102,8 @@ class CORE_EXPORT QgsRectangle
//! test if rectangle is empty.
//! Empty rectangle may still be non-null if it contains valid information (e.g. bounding box of a point)
bool isEmpty() const;
//! test if the rectangle has all coordinates zero. Null rectangle is also an empty rectangle.
//! test if the rectangle is null (all coordinates zero or after call to setMinimal()).
//! Null rectangle is also an empty rectangle.
//! @note added in 2.4
bool isNull() const;
//! returns string representation in Wkt form

0 comments on commit 3af01b3

Please sign in to comment.
You can’t perform that action at this time.