mirror of
https://github.com/fltk/fltk.git
synced 2026-06-05 16:12:13 +08:00
Under Mac OS 10.11 beta, fl_xyline(init,int,int) and fl_yxline(init,int,int) produce bizarre graphics just after
processing a mouse or keyboard event (they are OK in other cases). We fix that by filling a rectangle instead of stroking along a line (and hope the public 10.11 will have fixed that). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10803 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -202,6 +202,10 @@ void Fl_Graphics_Driver::xyline(int x, int y, int x1) {
|
||||
MoveToEx(fl_gc, x, y, 0L); LineTo(fl_gc, x1+1, y);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (fl_mac_os_version >= 101100) {
|
||||
// bizarrely, the line drawing does not always work with 10.11, draw a thin rectangle instead
|
||||
CGContextFillRect(fl_gc, CGRectMake((x1>x?x:x1) - 0.5, y - fl_quartz_line_width_/2, (x1>x?x1-x:x-x1)+1, fl_quartz_line_width_));
|
||||
} else {
|
||||
CGContextMoveToPoint(fl_gc, x, y);
|
||||
CGContextAddLineToPoint(fl_gc, x1, y);
|
||||
CGContextStrokePath(fl_gc);
|
||||
@@ -213,6 +217,7 @@ void Fl_Graphics_Driver::xyline(int x, int y, int x1) {
|
||||
CGContextFillRect(fl_gc, CGRectMake(x-0.5 , y - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_));
|
||||
CGContextFillRect(fl_gc, CGRectMake(x1-0.5 , y - fl_quartz_line_width_/2, 1 , fl_quartz_line_width_));
|
||||
}
|
||||
}
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
# error unsupported platform
|
||||
@@ -287,6 +292,12 @@ void Fl_Graphics_Driver::yxline(int x, int y, int y1) {
|
||||
MoveToEx(fl_gc, x, y, 0L); LineTo(fl_gc, x, y1);
|
||||
#elif defined(__APPLE_QUARTZ__)
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, true);
|
||||
if (fl_mac_os_version >= 101100) {
|
||||
// bizarrely, the line drawing does not always work with 10.11, draw a thin rectangle instead
|
||||
CGContextFillRect(fl_gc, CGRectMake(x - fl_quartz_line_width_/2, (y>y1?y1:y) - 0.5,
|
||||
fl_quartz_line_width_ , (y>y1?y-y1:y1-y)+1));
|
||||
}
|
||||
else {
|
||||
CGContextMoveToPoint(fl_gc, x, y);
|
||||
CGContextAddLineToPoint(fl_gc, x, y1);
|
||||
CGContextStrokePath(fl_gc);
|
||||
@@ -294,6 +305,7 @@ void Fl_Graphics_Driver::yxline(int x, int y, int y1) {
|
||||
CGContextFillRect(fl_gc, CGRectMake(x - fl_quartz_line_width_/2, y-0.5, fl_quartz_line_width_, 1));
|
||||
CGContextFillRect(fl_gc, CGRectMake(x - fl_quartz_line_width_/2, y1-0.5, fl_quartz_line_width_, 1));
|
||||
}
|
||||
}
|
||||
if (USINGQUARTZPRINTER || fl_quartz_line_width_ > 1.5f) CGContextSetShouldAntialias(fl_gc, false);
|
||||
#else
|
||||
# error unsupported platform
|
||||
|
||||
Reference in New Issue
Block a user