summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-05-13 07:42:44 +0000
committerManolo Gouy <Manolo>2018-05-13 07:42:44 +0000
commita4927c1d13a6969f0994b9961c5e4db5cd4dfa57 (patch)
treeb956f75bbcf08bb7902d47c6d9f7ea599a59d1af /src
parent10640df78599565cf708590893ed822976498fe1 (diff)
Fl_Scalable_Graphics_Driver::rect(): don't draw a rectangle if w or h is negative
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12920 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Graphics_Driver.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx
index ad0fd07cf..96c072d15 100644
--- a/src/Fl_Graphics_Driver.cxx
+++ b/src/Fl_Graphics_Driver.cxx
@@ -346,10 +346,12 @@ void Fl_Scalable_Graphics_Driver::rect(int x, int y, int w, int h)
if (int(scale()) == scale()) {
rect_unscaled(x * scale(), y * scale(), w * scale(), h * scale());
} else {
- xyline(x, y, x+w-1);
- yxline(x, y, y+h-1);
- yxline(x+w-1, y, y+h-1);
- xyline(x, y+h-1, x+w-1);
+ if (w > 0 && h > 0) {
+ xyline(x, y, x+w-1);
+ yxline(x, y, y+h-1);
+ yxline(x+w-1, y, y+h-1);
+ xyline(x, y+h-1, x+w-1);
+ }
}
}