summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-11-08 09:14:29 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-11-08 09:14:29 +0100
commit82e0e859ee51cd37a092122524f4a89d3708162f (patch)
tree782059a46b2761fd0b52f9b7179e2b3a01119910 /src/drivers
parent8f987ce8bdbc23b7e5ae3801c56842250f8afc0b (diff)
Fix X11: test/checkers drawing artifacts when window is scaled (#1109)
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx2
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
index dc5bbaca3..6033ed2a4 100644
--- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
+++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
@@ -1477,7 +1477,9 @@ void Fl_Cairo_Graphics_Driver::restore_clip() {
clip_->y = rect.y;
clip_->w = rect.width;
clip_->h = rect.height;
+ cairo_set_antialias(cairo_, CAIRO_ANTIALIAS_NONE);
cairo_clip(cairo_);
+ cairo_set_antialias(cairo_, CAIRO_ANTIALIAS_DEFAULT );
} else if (clip_) {
clip_->w = -1;
}
diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
index 290cb0873..912f9675c 100644
--- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
@@ -149,8 +149,8 @@ static void copy_region(struct wld_window *window, cairo_region_t *r) {
cairo_region_get_rectangle(r, i, &rect);
int left = rect.x * f;
int top = rect.y * f;
- int width = rect.width * f;
- int height = rect.height * f;
+ int width = ceil((rect.x + rect.width)*f) - left;
+ int height = ceil((rect.y + rect.height)*f) - top;
int offset = top * buffer->draw_buffer.stride + 4 * left;
int W4 = 4 * width;
for (int l = 0; l < height; l++) {