diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-02-26 18:00:07 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-05-31 08:28:06 +0200 |
| commit | b027d2ba57a8e0d6f0862e0a891ddd5dee4b02e2 (patch) | |
| tree | 3ed894bd9a891337804367a09de500ff060be640 /src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx | |
| parent | d95dd7acc4af3a4bd521d151ba3576b91d8ace53 (diff) | |
Windows platform: use GDI+ to antialias oblique lines and curves.
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx index 32a5c1689..0c1e90064 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_arci.cxx @@ -61,3 +61,29 @@ void Fl_GDI_Graphics_Driver::pie_unscaled(int x, int y, int w, int h, double a1, } else Pie(gc_, int(x), int(y), int(x+w), int(y+h), xa, ya, xb, yb); } else Pie(gc_, int(x), int(y), int(x+w), int(y+h), xa, ya, xb, yb); } + +#if USE_GDIPLUS + +void Fl_GDIplus_Graphics_Driver::arc_unscaled(int x, int y, int w, int h, double a1, double a2) { + if (w <= 0 || h <= 0) return; + if (!active) return Fl_GDI_Graphics_Driver::arc_unscaled(x, y, w, h, a1, a2); + Gdiplus::Graphics graphics_(gc_); + pen_->SetColor(gdiplus_color_); + Gdiplus::REAL oldw = pen_->GetWidth(); + Gdiplus::REAL new_w = (line_width_ <= scale() ? 1 : line_width_) * scale(); + pen_->SetWidth(new_w); + graphics_.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias); + graphics_.DrawArc(pen_, x, y, w, h, Gdiplus::REAL(-a1), Gdiplus::REAL(a1-a2)); + pen_->SetWidth(oldw); +} + +void Fl_GDIplus_Graphics_Driver::pie_unscaled(int x, int y, int w, int h, double a1, double a2) { + if (w <= 0 || h <= 0) return; + if (!active) return Fl_GDI_Graphics_Driver::pie_unscaled(x, y, w, h, a1, a2); + Gdiplus::Graphics graphics_(gc_); + brush_->SetColor(gdiplus_color_); + graphics_.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias); + graphics_.FillPie(brush_, x, y, w, h, Gdiplus::REAL(-a1), Gdiplus::REAL(a1-a2)); +} + +#endif |
