Bug 1267958: Only complain for negative size, not merely zero. r?jrmuizel draft
authorMilan Sreckovic <milan@mozilla.com>
Wed, 27 Apr 2016 12:51:12 -0400
changeset 356938 b0f2c241c69151ea0f3864ee52df10418f5f91c9
parent 356894 ab0044bfa1df858919797bcd6a9aef76a668cd4a
child 519529 203a41b4198428a8a7499ed1968da8494933689c
push id16650
push usermsreckovic@mozilla.com
push dateWed, 27 Apr 2016 16:51:32 +0000
reviewersjrmuizel
bugs1267958
milestone49.0a1
Bug 1267958: Only complain for negative size, not merely zero. r?jrmuizel MozReview-Commit-ID: JqtcPB292a7
gfx/2d/DrawTargetCairo.cpp
--- a/gfx/2d/DrawTargetCairo.cpp
+++ b/gfx/2d/DrawTargetCairo.cpp
@@ -1173,17 +1173,17 @@ void
 DrawTargetCairo::ClearRect(const Rect& aRect)
 {
   if (mTransformSingular) {
     return;
   }
 
   AutoPrepareForDrawing prep(this, mContext);
 
-  if (!mContext || aRect.Width() <= 0 || aRect.Height() <= 0 ||
+  if (!mContext || aRect.Width() < 0 || aRect.Height() < 0 ||
       !IsFinite(aRect.X()) || !IsFinite(aRect.Width()) ||
       !IsFinite(aRect.Y()) || !IsFinite(aRect.Height())) {
     gfxCriticalNote << "ClearRect with invalid argument " << gfx::hexa(mContext) << " with " << aRect.Width() << "x" << aRect.Height() << " [" << aRect.X() << ", " << aRect.Y() << "]";
   }
 
   cairo_set_antialias(mContext, CAIRO_ANTIALIAS_NONE);
   cairo_new_path(mContext);
   cairo_set_operator(mContext, CAIRO_OPERATOR_CLEAR);