summaryrefslogtreecommitdiff
path: root/src/drivers/GDI
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-11-12 07:46:00 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-11-12 07:46:12 +0100
commit231159e16c7bd8438f3e567507f5ad394d00c760 (patch)
tree7f66a27cc68c3daa5274fa0c53803bf77e07199d /src/drivers/GDI
parentdf9749e6a8a72da60d80d9f519377f3c12a9409e (diff)
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.
Diffstat (limited to 'src/drivers/GDI')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx8
1 files changed, 4 insertions, 4 deletions
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)) {