summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-10-14 14:57:29 +0200
committerMatthias Melcher <github@matthiasm.com>2023-10-14 14:57:29 +0200
commit56ad8f8a78117dbd94cbc0b74c20fab4cca832bc (patch)
tree3894b994ed709b91046c2d71a0166578d7fad01c /src
parentded5839d9c37d5f2af27f1bab0a2998a29893bdf (diff)
Draws nicer small circles if display is scaled up.
Diffstat (limited to 'src')
-rw-r--r--src/fl_draw.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx
index 5073d4ee4..142d81257 100644
--- a/src/fl_draw.cxx
+++ b/src/fl_draw.cxx
@@ -615,9 +615,14 @@ void fl_draw_circle(int x0, int y0, int d, Fl_Color color) {
fl_rectf(x0, y0, d, d, FL_GREEN);
#endif
+ // make circles nice on scaled display
+ // note: we should scale the value up even more for hidpi displays like Apple's Retina
+ float scale = fl_graphics_driver->scale();
+ int scaled_d = (scale>1.0) ? ((int)(d*fl_graphics_driver->scale())) : d;
+
// draw the circle
- switch (d) {
+ switch (scaled_d) {
// Larger circles draw fine...
default:
fl_pie(x0, y0, d, d, 0.0, 360.0);