From c46a92809e86d22520e01cd4d1581d7c288cd320 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:07:32 +0100 Subject: Fix macOS Very minor high DPI rounding issue with fl_rect (#1113) --- src/drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/drivers') 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) -- cgit v1.2.3