From 4258aca717e30ccb0b07820dd0a471ad7e168198 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:36:49 +0100 Subject: Fix: Can't control scale of Fl_Copy_Surface dimensions on Linux (#1135) --- src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx | 6 ++---- src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx index 3d8774fe1..cf334b2ad 100644 --- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx +++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx @@ -1493,8 +1493,7 @@ char Fl_Cairo_Graphics_Driver::can_do_alpha_blending() { float Fl_Cairo_Graphics_Driver::override_scale() { float s = scale(); if (s != 1.f && Fl_Display_Device::display_device()->is_current()) { - Fl::screen_driver()->scale(0, 1.f); - cairo_scale(cairo_, 1/s, 1/s); + scale(1); } return s; } @@ -1502,8 +1501,7 @@ float Fl_Cairo_Graphics_Driver::override_scale() { void Fl_Cairo_Graphics_Driver::restore_scale(float s) { if (s != 1.f && Fl_Display_Device::display_device()->is_current()) { - Fl::screen_driver()->scale(0, s); - cairo_scale(cairo_, s, s); + scale(s); } } diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx index fcd9e89c7..a9ca6cc88 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx @@ -159,15 +159,13 @@ void Fl_Quartz_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &heigh float Fl_Quartz_Graphics_Driver::override_scale() { float s = scale(); if (s != 1.f && Fl_Display_Device::display_device()->is_current()) { - Fl::screen_driver()->scale(0, 1.f); - CGContextScaleCTM(gc_, 1/s, 1/s); + scale(1); } return s; } void Fl_Quartz_Graphics_Driver::restore_scale(float s) { if (s != 1.f && Fl_Display_Device::display_device()->is_current()) { - Fl::screen_driver()->scale(0, s); - CGContextScaleCTM(gc_, s, s); + scale(s); } } -- cgit v1.2.3