From 6f5340d430aa0a1a13dc7ce527424a9c50c1382d Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 9 Feb 2018 16:59:34 +0000 Subject: Windows: fix fl_overlay_rect() when scaling factor value is > 2 git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12656 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/GDI/Fl_GDI_Graphics_Driver.H | 1 + src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/drivers') diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H index 1ab61722b..5bfd9b515 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -147,6 +147,7 @@ protected: virtual const char *font_name(int num); virtual void font_name(int num, const char *name); void global_gc(); + virtual void overlay_rect(int x, int y, int w , int h); }; diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx index 0dbb674f0..40ba82472 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx @@ -43,6 +43,12 @@ void Fl_GDI_Graphics_Driver::point_unscaled(float fx, float fy) { FillRect(gc_, &rect, fl_brush()); } +void Fl_GDI_Graphics_Driver::overlay_rect(int x, int y, int w , int h) { + // make pen have a one-pixel width + line_style_unscaled( (color()==FL_WHITE?FL_SOLID:FL_DOT), 1, NULL); + loop(x, y, x+w-1, y, x+w-1, y+h-1, x, y+h-1); +} + void Fl_GDI_Graphics_Driver::rect_unscaled(float x, float y, float w, float h) { if (w<=0 || h<=0) return; int line_delta_ = (scale_ > 1.75 ? 1 : 0);//TMP @@ -248,7 +254,6 @@ void Fl_GDI_Graphics_Driver::restore_clip() { } } - // // End of "$Id$". // -- cgit v1.2.3