summaryrefslogtreecommitdiff
path: root/src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-01-08 14:37:57 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-01-08 14:37:57 +0100
commitc0c2cf7d408fc6bfefd9eecbfe5aabcbc4d55ff3 (patch)
tree2d84ced5a6069a7841afebfb277fbcbe0d743561 /src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
parentca786597f773eb6f064fcb98a1e9437d2cfe8ac4 (diff)
Make draw to image and draw to clipboard behave equally in X11 and Wayland
Diffstat (limited to 'src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx')
-rw-r--r--src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
index 3ad9a0d88..926121bdb 100644
--- a/src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
+++ b/src/drivers/Cairo/Fl_X11_Cairo_Graphics_Driver.cxx
@@ -48,8 +48,13 @@ void Fl_X11_Cairo_Graphics_Driver::scale(float f) {
}
-void Fl_X11_Cairo_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) {
- XCopyArea(fl_display, pixmap, fl_window, (GC)Fl_Graphics_Driver::default_driver().gc(), int(srcx*scale()), int(srcy*scale()), int(w*scale()), int(h*scale()), int(x*scale()), int(y*scale()));
+void Fl_X11_Cairo_Graphics_Driver::copy_offscreen(int x, int y, int w, int h,
+ Fl_Offscreen pixmap, int srcx, int srcy) {
+ cairo_matrix_t mat;
+ if (cairo_) cairo_get_matrix(cairo_, &mat);
+ else cairo_matrix_init_identity(&mat);
+ XCopyArea(fl_display, pixmap, fl_window, (GC)Fl_Graphics_Driver::default_driver().gc(), int(srcx*scale()), int(srcy*scale()), int(w*scale()), int(h*scale()),
+ int(x*scale()) + mat.x0, int(y*scale()) + mat.y0);
}