From 889acc7d74a8d5c79d4016900294246a9b04b9c2 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 30 Jul 2020 17:41:22 +0200 Subject: Fix use of an SVG image in Fl_Tiled_Image when display is rescaled. --- src/Fl_Graphics_Driver.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Fl_Graphics_Driver.cxx') diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index 81b9f29ed..125f79072 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -200,7 +200,7 @@ unsigned Fl_Graphics_Driver::font_desc_size() { /** Converts \p width and \p height from FLTK units to drawing units. The conversion performed consists in multiplying \p width and \p height by scale() and in slightly modifying that to help support tiled images. */ -void Fl_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &height) +void Fl_Graphics_Driver::cache_size(int &width, int &height) { if ( int(scale()) == scale() ) { width = width * scale(); @@ -222,7 +222,7 @@ void Fl_Graphics_Driver::draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int } // to allow rescale at runtime int w2=pxm->w(), h2=pxm->h(); - cache_size(pxm, w2, h2); // after this, w2 x h2 is size of desired cached image + cache_size(w2, h2); // after this, w2 x h2 is size of desired cached image int *pw, *ph; cache_w_h(pxm, pw, ph); // after this, *pw x *ph is current size of cached form of bitmap if (*id(pxm) && (*pw != w2 || *ph != h2)) { @@ -255,7 +255,7 @@ void Fl_Graphics_Driver::draw_bitmap(Fl_Bitmap *bm, int XP, int YP, int WP, int return; } int w2 = bm->w(), h2 = bm->h(); - cache_size(bm, w2, h2); // after this, w2 x h2 is size of desired cached image + cache_size(w2, h2); // after this, w2 x h2 is size of desired cached image int *pw, *ph; cache_w_h(bm, pw, ph); // after this, *pw x *ph is current size of cached form of bitmap if (*id(bm) && (*pw != w2 || *ph != h2)) { @@ -295,7 +295,7 @@ void Fl_Graphics_Driver::draw_rgb(Fl_RGB_Image *img, int XP, int YP, int WP, int int w2, h2, *pw, *ph; if (need_scaled_drawing) { w2 = img->w(); h2 = img->h(); - cache_size(img, w2, h2); + cache_size(w2, h2); } else { w2 = img->data_w(); h2 = img->data_h(); } // after this, w2 x h2 is desired cached image size -- cgit v1.2.3