Index: include/core/SkRect.h |
diff --git a/include/core/SkRect.h b/include/core/SkRect.h |
index d9ef7a5ecfc2cbc2ee79bbcb717c13c0eac461a2..995beb8662ee8a8e395b50435c8e33c44ecce2ca 100644 |
--- a/include/core/SkRect.h |
+++ b/include/core/SkRect.h |
@@ -1,4 +1,3 @@ |
- |
/* |
* Copyright 2006 The Android Open Source Project |
* |
@@ -6,7 +5,6 @@ |
* found in the LICENSE file. |
*/ |
- |
#ifndef SkRect_DEFINED |
#define SkRect_DEFINED |
@@ -842,7 +840,17 @@ public: |
* if the edges are computed separately, and may have crossed over each |
* other. When this returns, left <= right && top <= bottom |
*/ |
- void sort(); |
+ void sort() { |
+ SkScalar min = SkMinScalar(fLeft, fRight); |
+ SkScalar max = SkMaxScalar(fLeft, fRight); |
+ fLeft = min; |
+ fRight = max; |
+ |
+ min = SkMinScalar(fTop, fBottom); |
+ max = SkMaxScalar(fTop, fBottom); |
+ fTop = min; |
+ fBottom = max; |
+ } |
/** |
* cast-safe way to treat the rect as an array of (4) SkScalars. |