FLTK logo

[master] db7bb6c - Have Fl_Quartz_Copy_Surface_Driver account for current display scaling factor.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] db7bb6c - Have Fl_Quartz_Copy_Surface_Driver account for current display scaling factor. "ManoloFLTK" Aug 05, 2021  
 
commit db7bb6cd9854804a9733812d82559284c2b2dc43
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Thu Aug 5 19:20:53 2021 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Thu Aug 5 19:21:05 2021 +0200

    Have Fl_Quartz_Copy_Surface_Driver account for current display scaling factor.

 src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx
index 0933a4a..401fd1d 100644
--- src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx
+++ 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);
   }
 }
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.