mirror of
https://github.com/fltk/fltk.git
synced 2026-05-22 15:22:34 +08:00
Have Fl_Quartz_Copy_Surface_Driver account for current display scaling factor.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user