summaryrefslogtreecommitdiff
path: root/cairo
diff options
context:
space:
mode:
Diffstat (limited to 'cairo')
-rw-r--r--cairo/Fl_Cairo.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/cairo/Fl_Cairo.cxx b/cairo/Fl_Cairo.cxx
index 41a4e4b6d..de70d33df 100644
--- a/cairo/Fl_Cairo.cxx
+++ b/cairo/Fl_Cairo.cxx
@@ -84,11 +84,20 @@ cairo_t * Fl::cairo_make_current(Fl_Window* wi) {
cairo_state_.window(wi);
+ cairo_t * cairo_ctxt;
+#ifndef __APPLE__
+ float scale = Fl::screen_scale(wi->screen_num()); // get the screen scaling factor
+#endif
#if defined(USE_X11)
- return Fl::cairo_make_current(0, wi->w(), wi->h());
+ cairo_ctxt = Fl::cairo_make_current(0, wi->w() * scale, wi->h() * scale);
#else
- return Fl::cairo_make_current(fl_gc, wi->w(), wi->h());
+ // on macOS, scaling is done before by Fl_Window::make_current(), on Windows, the size is not used
+ cairo_ctxt = Fl::cairo_make_current(fl_gc, wi->w(), wi->h());
+#endif
+#ifndef __APPLE__
+ cairo_scale(cairo_ctxt, scale, scale);
#endif
+ return cairo_ctxt;
}
/*