From 4f894e4745280958e1e4a08f4e49bd94abb5ea36 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 25 Nov 2023 12:09:54 +0100 Subject: Cairo graphics driver: Improve drawing of Fl_Pixmap and Fl_Bitmap Previously, these objects were drawn slightly blurred on HighDPI. This commit has them resized to the pixel size of the area where they are being drawn and then drawn. --- src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx') diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx index 34e4971da..b2def3703 100644 --- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx @@ -287,3 +287,10 @@ Fl_Image_Surface *Fl_Wayland_Graphics_Driver::custom_offscreen(int w, int h, cairo_set_user_data(off->draw_buffer.cairo_, &key, &off->draw_buffer, NULL); return new Fl_Image_Surface(w, h, 0, (Fl_Offscreen)off->draw_buffer.cairo_); } + + +void Fl_Wayland_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &height) { + Fl_Graphics_Driver::cache_size(img, width, height); + width *= wld_scale; + height *= wld_scale; +} -- cgit v1.2.3