summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-06-06 19:09:02 +0000
committerManolo Gouy <Manolo>2017-06-06 19:09:02 +0000
commit6b2c5fcd0978422a3e58174658f68f0ad28782f8 (patch)
treeb8f1106977d487c8682cd2ef434f54a7f8a6fc8c /src/drivers
parenta6e2c33ffdea70e85988bce80c67533f4aa15e05 (diff)
X11 platform: Accurate box graphics at wide range of scaling factor values.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12254 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
index bc318a7e9..183c78956 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
@@ -214,7 +214,8 @@ void Fl_Xlib_Graphics_Driver::xyline_unscaled(float x, float y, float x1) {//OK
if (x > x1) { float exch = x; x = x1; x1 = exch; }
int ix = clip_x(x+line_delta_); if (scale_ >= 2) ix -= int(scale_/2);
int iy = clip_x(y+line_delta_);
- int ix1 = int(x1/scale_+1.5)*scale_-1; if (scale_ >= 2) ix1 += int(scale_/2); if (scale_ >= 4) ix1 -= scale_/2;
+ int ix1 = int(x1/scale_+1.5)*scale_-1; // extend line to pixel before line beginning at x1/scale_ + 1
+ ix1 += line_delta_; if (scale_ >= 4) ix1 -= 1;
XDrawLine(fl_display, fl_window, gc_, ix, iy, ix1, iy);
// try and make sure no unfilled area lies between xyline(x,y,x1) and xyline(x,y+1,x1)
if (y+line_delta_ + scale_ >= iy + tw+1 - 0.001 ) XDrawLine(fl_display, fl_window, gc_, ix, iy+1, ix1, iy+1);
@@ -253,7 +254,8 @@ void Fl_Xlib_Graphics_Driver::yxline_unscaled(float x, float y, float y1) {//OK
if (y > y1) { float exch = y; y = y1; y1 = exch; }
int ix = clip_x(x+line_delta_);
int iy = clip_x(y+line_delta_); if (scale_ >= 2) iy -= int(scale_/2);
- int iy1 = int(y1/scale_+1.5)*scale_-1; if (scale_ >= 2) iy1 += int(scale_/2); if (scale_ >= 4) iy1 -= scale_/2;
+ int iy1 = int(y1/scale_+1.5)*scale_-1;
+ iy1 += line_delta_; if (scale_ >= 4) iy1 -= 1; // extend line to pixel before line beginning at y1/scale_ + 1
XDrawLine(fl_display, fl_window, gc_, ix, iy, ix, iy1);
// try and make sure no unfilled area lies between yxline(x,y,y1) and yxline(x+1,y,y1)
if (x+line_delta_+scale_ >= ix + tw+1 -0.001) XDrawLine(fl_display, fl_window, gc_, ix+1, iy, ix+1, iy1);