summaryrefslogtreecommitdiff
path: root/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-05-21 21:17:11 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-05-21 21:17:11 +0200
commit9b80a38345d2197654c4610f3d3812e27a301c36 (patch)
tree64e61aa88d8c5d872f03eff60e28592d3e9938da /src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx
parent07f4fd43802183721e3e69f2d828af5f5820ea5a (diff)
Support for fl_scroll() under macOS when GUI is scaled
Diffstat (limited to 'src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx')
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx
index e48cd0361..8266f16e8 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx
@@ -75,7 +75,7 @@ void Fl_Quartz_Graphics_Driver::xyline(int x, int y, int x1) {
CGContextMoveToPoint(gc_, x, y);
CGContextAddLineToPoint(gc_, x1, y);
CGContextStrokePath(gc_);
- if (high_resolution()) {
+ if (high_resolution() || scale()>=2) {
/* On retina displays, all xyline() and yxline() functions produce lines that are half-unit
(or one pixel) too short at both ends. This is corrected by filling at both ends rectangles
of size one unit by line-width.
@@ -92,7 +92,7 @@ void Fl_Quartz_Graphics_Driver::xyline(int x, int y, int x1, int y2) {
CGContextAddLineToPoint(gc_, x1, y);
CGContextAddLineToPoint(gc_, x1, y2);
CGContextStrokePath(gc_);
- if (high_resolution()) {
+ if (high_resolution() || scale()>=2) {
CGContextFillRect(gc_, CGRectMake(x-0.5, y - quartz_line_width_/2, 1 , quartz_line_width_));
CGContextFillRect(gc_, CGRectMake(x1 - quartz_line_width_/2, y2-0.5, quartz_line_width_, 1));
}
@@ -106,7 +106,7 @@ void Fl_Quartz_Graphics_Driver::xyline(int x, int y, int x1, int y2, int x3) {
CGContextAddLineToPoint(gc_, x1, y2);
CGContextAddLineToPoint(gc_, x3, y2);
CGContextStrokePath(gc_);
- if (high_resolution()) {
+ if (high_resolution() || scale()>=2) {
CGContextFillRect(gc_, CGRectMake(x-0.5, y - quartz_line_width_/2, 1 , quartz_line_width_));
CGContextFillRect(gc_, CGRectMake(x3-0.5, y2 - quartz_line_width_/2, 1 , quartz_line_width_));
}
@@ -118,7 +118,7 @@ void Fl_Quartz_Graphics_Driver::yxline(int x, int y, int y1) {
CGContextMoveToPoint(gc_, x, y);
CGContextAddLineToPoint(gc_, x, y1);
CGContextStrokePath(gc_);
- if (high_resolution()) {
+ if (high_resolution() || scale()>=2) {
CGContextFillRect(gc_, CGRectMake(x - quartz_line_width_/2, y-0.5, quartz_line_width_, 1));
CGContextFillRect(gc_, CGRectMake(x - quartz_line_width_/2, y1-0.5, quartz_line_width_, 1));
}
@@ -131,7 +131,7 @@ void Fl_Quartz_Graphics_Driver::yxline(int x, int y, int y1, int x2) {
CGContextAddLineToPoint(gc_, x, y1);
CGContextAddLineToPoint(gc_, x2, y1);
CGContextStrokePath(gc_);
- if (high_resolution()) {
+ if (high_resolution() || scale()>=2) {
CGContextFillRect(gc_, CGRectMake(x - quartz_line_width_/2, y-0.5, quartz_line_width_, 1));
CGContextFillRect(gc_, CGRectMake(x2-0.5, y1 - quartz_line_width_/2, 1 , quartz_line_width_));
}
@@ -145,7 +145,7 @@ void Fl_Quartz_Graphics_Driver::yxline(int x, int y, int y1, int x2, int y3) {
CGContextAddLineToPoint(gc_, x2, y1);
CGContextAddLineToPoint(gc_, x2, y3);
CGContextStrokePath(gc_);
- if (high_resolution()) {
+ if (high_resolution() || scale()>=2) {
CGContextFillRect(gc_, CGRectMake(x - quartz_line_width_/2, y-0.5, quartz_line_width_, 1));
CGContextFillRect(gc_, CGRectMake(x2 - quartz_line_width_/2, y3-0.5, quartz_line_width_, 1));
}