diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-10-25 15:20:34 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-10-25 15:20:34 +0200 |
| commit | 06d12892f90233c4ec50109fc2d2f06c5ae14432 (patch) | |
| tree | 9d1f1b39923d8b8787cdf2aeafe130ffaebe887f /src | |
| parent | b270e1409caa23f8333c3eafb48534cb42957f12 (diff) | |
Fix "Wayland: Overlay windows look blurred" - cont'd (#808)
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx index 087c3c49c..5cac257ef 100644 --- a/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx @@ -22,7 +22,8 @@ Fl_Wayland_Image_Surface_Driver::Fl_Wayland_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off) : Fl_Image_Surface_Driver(w, h, high_res, off) { - float d = 1; + float s = 1; + int d = 1; if (!off) { fl_open_display(); if (Fl_Wayland_Window_Driver::wld_window) { @@ -30,10 +31,10 @@ Fl_Wayland_Image_Surface_Driver::Fl_Wayland_Image_Surface_Driver(int w, int h, Fl_Wayland_Window_Driver::wld_window->fl_win )->wld_scale(); } - d *= fl_graphics_driver->scale(); - if (d != 1 && high_res) { - w = int(w * d); - h = int(h * d); + s = fl_graphics_driver->scale(); + if (d*s != 1 && high_res) { + w = int(w * s) * d; + h = int(h * s) * d; } struct Fl_Wayland_Graphics_Driver::draw_buffer *off_ = (struct Fl_Wayland_Graphics_Driver::draw_buffer*)calloc(1, @@ -44,7 +45,7 @@ Fl_Wayland_Image_Surface_Driver::Fl_Wayland_Image_Surface_Driver(int w, int h, cairo_set_user_data(off_->cairo_, &Fl_Wayland_Graphics_Driver::key, off_, NULL); } driver(new Fl_Wayland_Graphics_Driver()); - if (d != 1 && high_res) driver()->scale(d); + if (d*s != 1 && high_res) driver()->scale(d*s); } |
