aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/gmmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/gmmain.cpp')
-rw-r--r--gm/gmmain.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index ece8ff32d4..1652e61f7c 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -704,8 +704,10 @@ public:
SkRect content = SkRect::MakeWH(SkIntToScalar(pageSize.width()),
SkIntToScalar(pageSize.height()));
initialTransform.mapRect(&content);
- content.intersect(0, 0, SkIntToScalar(pageSize.width()),
- SkIntToScalar(pageSize.height()));
+ if (!content.intersect(0, 0, SkIntToScalar(pageSize.width()),
+ SkIntToScalar(pageSize.height()))) {
+ content.setEmpty();
+ }
SkISize contentSize =
SkISize::Make(SkScalarRoundToInt(content.width()),
SkScalarRoundToInt(content.height()));