From 231159e16c7bd8438f3e567507f5ad394d00c760 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Thu, 12 Nov 2020 07:46:00 +0100 Subject: Fix for issue #155 - continued The issue lies in details how floating point scaled coordinates are converted to integer values and its impact on the drawing of large SVG images. This commit fixes the X11 platform. The macOS platform is immune because drawing uses floating point coordinates. The Windows platform still needs fixing. --- src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/drivers/GDI') diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index 37507b435..6bc9ad82d 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -400,7 +400,7 @@ void Fl_GDI_Graphics_Driver::delete_bitmask(Fl_Bitmask bm) { void Fl_GDI_Graphics_Driver::draw_fixed(Fl_Bitmap *bm, int X, int Y, int W, int H, int cx, int cy) { X = X*scale(); Y = Y*scale(); - cache_size(W, H); + cache_size(bm, W, H); cx *= scale(); cy *= scale(); HDC tempdc = CreateCompatibleDC(gc_); @@ -500,7 +500,7 @@ void Fl_GDI_Graphics_Driver::cache(Fl_RGB_Image *img) void Fl_GDI_Graphics_Driver::draw_fixed(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, int cy) { X = X*scale(); Y = Y*scale(); - cache_size(W, H); + cache_size(img, W, H); cx *= scale(); cy *= scale(); if (W + cx > img->data_w()) W = img->data_w() - cx; if (H + cy > img->data_h()) H = img->data_h() - cy; @@ -538,7 +538,7 @@ void Fl_GDI_Graphics_Driver::draw_rgb(Fl_RGB_Image *rgb, int XP, int YP, int WP, float scaleW = float(rgb->data_w())/rgb->w(); float scaleH = float(rgb->data_h())/rgb->h(); int W = WP, H = HP; - cache_size(W, H); + cache_size(rgb, W, H); HDC new_gc = CreateCompatibleDC(gc_); int save = SaveDC(new_gc); SelectObject(new_gc, (HBITMAP)*Fl_Graphics_Driver::id(rgb)); @@ -628,7 +628,7 @@ void Fl_GDI_Graphics_Driver::cache(Fl_Bitmap *bm) { void Fl_GDI_Graphics_Driver::draw_fixed(Fl_Pixmap *pxm, int X, int Y, int W, int H, int cx, int cy) { X = X*scale(); Y = Y*scale(); - cache_size(W, H); + cache_size(pxm, W, H); cx *= scale(); cy *= scale(); Fl_Region r2 = scale_clip(scale()); if (*Fl_Graphics_Driver::mask(pxm)) { -- cgit v1.2.3