aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkRRect.h1
-rw-r--r--src/core/SkRRect.cpp7
2 files changed, 7 insertions, 1 deletions
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h
index 994edd2cc1..5564ce0d7e 100644
--- a/include/core/SkRRect.h
+++ b/include/core/SkRRect.h
@@ -326,6 +326,7 @@ private:
void computeType();
bool checkCornerContainment(SkScalar x, SkScalar y) const;
+ void scaleRadii();
// to access fRadii directly
friend class SkPath;
diff --git a/src/core/SkRRect.cpp b/src/core/SkRRect.cpp
index 2e03f81200..2195dcfb13 100644
--- a/src/core/SkRRect.cpp
+++ b/src/core/SkRRect.cpp
@@ -158,6 +158,11 @@ void SkRRect::setRectRadii(const SkRect& rect, const SkVector radii[4]) {
return;
}
+ this->scaleRadii();
+}
+
+void SkRRect::scaleRadii() {
+
// Proportionally scale down all radii to fit. Find the minimum ratio
// of a side and the radii on that side (for all four sides) and use
// that to scale down _all_ the radii. This algorithm is from the
@@ -420,7 +425,7 @@ bool SkRRect::transform(const SkMatrix& matrix, SkRRect* dst) const {
SkTSwap(dst->fRadii[kUpperRight_Corner], dst->fRadii[kLowerRight_Corner]);
}
- SkDEBUGCODE(dst->validate();)
+ dst->scaleRadii();
return true;
}