diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-05-28 13:29:05 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-05-28 13:30:59 +0200 |
| commit | d95dd7acc4af3a4bd521d151ba3576b91d8ace53 (patch) | |
| tree | cda2a4e0b87730f5357cb01bc7e3a8e035d739dc /src/drivers/GDI | |
| parent | 47ba6632b1be5ab7f28726735fc7789916191ca7 (diff) | |
New virtual member function Fl_Graphics_Driver::colored_rectf().
Diffstat (limited to 'src/drivers/GDI')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver.H | 3 | ||||
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx | 10 | ||||
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx | 1 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H index 9016e9f5a..76d9c5c01 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -98,6 +98,9 @@ protected: virtual void point(int x, int y); void focus_rect(int x, int y, int w, int h); virtual void rectf_unscaled(int x, int y, int w, int h); +#if USE_COLORMAP + virtual void colored_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b); +#endif virtual void line_unscaled(int x, int y, int x1, int y1); virtual void line_unscaled(int x, int y, int x1, int y1, int x2, int y2); virtual void xyline_unscaled(int x, int y, int x1); diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index 103264068..e10466088 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -320,19 +320,19 @@ void Fl_GDI_Graphics_Driver::draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* } } -void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) { #if USE_COLORMAP +void Fl_GDI_Graphics_Driver::colored_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) { // use the error diffusion dithering code to produce a much nicer block: if (fl_palette) { uchar c[3]; c[0] = r; c[1] = g; c[2] = b; - innards(c,x,y,w,h,0,0,0,0,0,(HDC)fl_graphics_driver->gc()); + innards(c, floor(x), floor(y), floor(x + w) - floor(x), floor(y + h) - floor(y), + 0,0,0,0,0, (HDC)gc()); return; } -#endif - fl_color(r,g,b); - fl_rectf(x,y,w,h); + Fl_Graphics_Driver::colored_rectf(x, y, w, h, r, g, b); } +#endif // 'fl_create_bitmask()' - Create an N-bit bitmap for masking... Fl_Bitmask Fl_GDI_Graphics_Driver::create_bitmask(int w, int h, const uchar *data) { diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx index 2cf6d8260..91cfe2ca4 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx @@ -46,6 +46,7 @@ void Fl_GDI_Graphics_Driver::line_style_unscaled(int style, int width, char* das s1 |= style & 0xff; // allow them to pass any low 8 bits for style } if ((style || n) && !width) width = int(scale()); // fix cards that do nothing for 0? + if (!width) width = 1; if (!fl_current_xmap) color(FL_BLACK); LOGBRUSH penbrush = {BS_SOLID,fl_RGB(),0}; // can this be fl_brush()? HPEN newpen = ExtCreatePen(s1, width, &penbrush, n, n ? a : 0); |
