diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-11-08 11:07:32 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-11-08 11:07:32 +0100 |
| commit | c46a92809e86d22520e01cd4d1581d7c288cd320 (patch) | |
| tree | d868363518133b38c5c6464e01fc93e8b03d5394 | |
| parent | e15cd9d5bb5ee672419f29ef44a7dee140833225 (diff) | |
Fix macOS Very minor high DPI rounding issue with fl_rect (#1113)
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx index 71daf0e10..234853ad6 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx @@ -37,10 +37,9 @@ void Fl_Quartz_Graphics_Driver::point(int x, int y) { void Fl_Quartz_Graphics_Driver::rect(int x, int y, int w, int h) { if (w<=0 || h<=0) return; - if ( (!has_feature(PRINTER)) && quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(gc_, true); - CGRect rect = CGRectMake(x, y, w-1, h-1); + double offset = (quartz_line_width_ >= 2 ? quartz_line_width_/4 : 0); + CGRect rect = CGRectMake(x - offset, y - offset, w-1, h-1); CGContextStrokeRect(gc_, rect); - if ( (!has_feature(PRINTER)) && quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(gc_, false); } void Fl_Quartz_Graphics_Driver::focus_rect(int x, int y, int w, int h) |
