mirror of
https://github.com/fltk/fltk.git
synced 2026-05-10 05:27:55 +08:00
Fix "Mac: Most fl_symbols missing corner pixels" (#1409).
+ Fix line loop drawing on macOS (#1409) + macOS: yet another fix of line drawing (#1409) All fixes backported and merged from master, commits: -ea1b1bddd9-e19bc59ec1-3c8bc27458
This commit is contained in:
committed by
Albrecht Schlosser
parent
1869ba9455
commit
efef8eb219
@@ -108,7 +108,9 @@ protected:
|
||||
int not_clipped(int x, int y, int w, int h) FL_OVERRIDE;
|
||||
void restore_clip() FL_OVERRIDE;
|
||||
void end_points() FL_OVERRIDE;
|
||||
void end_loop() FL_OVERRIDE;
|
||||
void end_line() FL_OVERRIDE;
|
||||
void end_line_or_loop(bool is_loop);
|
||||
void end_polygon() FL_OVERRIDE;
|
||||
void end_complex_polygon() FL_OVERRIDE;
|
||||
void circle(double x, double y, double r) FL_OVERRIDE;
|
||||
|
||||
@@ -33,7 +33,16 @@ void Fl_Quartz_Graphics_Driver::end_points() {
|
||||
}
|
||||
}
|
||||
|
||||
void Fl_Quartz_Graphics_Driver::end_loop() {
|
||||
fixloop();
|
||||
end_line_or_loop(true);
|
||||
}
|
||||
|
||||
void Fl_Quartz_Graphics_Driver::end_line() {
|
||||
end_line_or_loop(false);
|
||||
}
|
||||
|
||||
void Fl_Quartz_Graphics_Driver::end_line_or_loop(bool is_loop) {
|
||||
if (n < 2) {
|
||||
end_points();
|
||||
return;
|
||||
@@ -43,6 +52,8 @@ void Fl_Quartz_Graphics_Driver::end_line() {
|
||||
CGContextMoveToPoint(gc_, xpoint[0].x, xpoint[0].y);
|
||||
for (int i=1; i<n; i++)
|
||||
CGContextAddLineToPoint(gc_, xpoint[i].x, xpoint[i].y);
|
||||
if (is_loop)
|
||||
CGContextClosePath(gc_);
|
||||
CGContextStrokePath(gc_);
|
||||
CGContextSetShouldAntialias(gc_, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user