summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-08-05 19:20:53 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-08-05 19:21:05 +0200
commitdb7bb6cd9854804a9733812d82559284c2b2dc43 (patch)
treeeb270e11b31447a5cd6f852e30463e35fb2a2567
parente4ce39559a00e15ca25a83e117306a651f6bdeb3 (diff)
Have Fl_Quartz_Copy_Surface_Driver account for current display scaling factor.
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx
index 0933a4aa0..401fd1daf 100644
--- a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx
@@ -50,13 +50,14 @@ Fl_Quartz_Copy_Surface_Driver::Fl_Quartz_Copy_Surface_Driver(int w, int h) : Fl_
static CGDataConsumerCallbacks callbacks = { Fl_Quartz_Copy_Surface_Driver::MyPutBytes, NULL };
myconsumer = CGDataConsumerCreate((void*) pdfdata, &callbacks);
}
- CGRect bounds = CGRectMake(0, 0, w, h );
+ float d = fl_graphics_driver->scale();
+ CGRect bounds = CGRectMake(0, 0, w * d, h * d);
gc = CGPDFContextCreate(myconsumer, &bounds, NULL);
CGDataConsumerRelease(myconsumer);
if (gc) {
CGContextBeginPage(gc, &bounds);
- CGContextTranslateCTM(gc, 0.5, h-0.5);
- CGContextScaleCTM(gc, 1.0f, -1.0f);
+ CGContextScaleCTM(gc, d, -d);
+ CGContextTranslateCTM(gc, 0.5, -h + 0.5);
CGContextSaveGState(gc);
}
}