summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2018-03-23 23:09:24 +0000
committerMatthias Melcher <fltk@matthiasm.com>2018-03-23 23:09:24 +0000
commit5843a450bc27de3118808c1aece5accfab7b3ef0 (patch)
tree3d0715d4955cedcf3f2562e3cc776313fdb1b136 /src/drivers
parentd695ccb2d29d03a02b25289c41499f615aae5b3a (diff)
Android: Using xlib shortcut to draw circles and ellipses.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12790 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver.H2
-rw-r--r--src/drivers/Android/Fl_Android_Graphics_Driver.cxx17
2 files changed, 18 insertions, 1 deletions
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.H b/src/drivers/Android/Fl_Android_Graphics_Driver.H
index 2458d6569..eebd05db1 100644
--- a/src/drivers/Android/Fl_Android_Graphics_Driver.H
+++ b/src/drivers/Android/Fl_Android_Graphics_Driver.H
@@ -86,6 +86,7 @@ public:
virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) override;
virtual void arc_unscaled(float x, float y, float w, float h, double a1, double a2) override;
virtual void pie_unscaled(float x, float y, float w, float h, double a1, double a2) override;
+ virtual void ellipse_unscaled(double xt, double yt, double rx, double ry) override;
// --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
virtual void begin_points() override;
@@ -151,7 +152,6 @@ protected:
void fixloop();
// --- implementation is in src/fl_rect.cxx which includes src/cfg_gfx/gdi_rect.cxx
virtual Fl_Region scale_clip(float f);
- virtual void ellipse_unscaled(double xt, double yt, double rx, double ry);
// --- implementation is in src/fl_arc.cxx which includes src/cfg_gfx/xxx_arc.cxx if needed
// using void Fl_Graphics_Driver::arc(double x, double y, double r, double start, double end);
// --- implementation is in src/fl_arci.cxx which includes src/cfg_gfx/xxx_arci.cxx
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx
index 46d638767..908b7f5bd 100644
--- a/src/drivers/Android/Fl_Android_Graphics_Driver.cxx
+++ b/src/drivers/Android/Fl_Android_Graphics_Driver.cxx
@@ -887,6 +887,23 @@ void Fl_Android_Graphics_Driver::pie_unscaled(float xi, float yi, float w, float
}
}
+/**
+ * shortcut the closed circles so they use XDrawArc:
+ * FIXME: these do not draw rotated ellipses correctly!
+ * */
+void Fl_Android_Graphics_Driver::ellipse_unscaled(double xt, double yt, double rx, double ry) {
+ int llx = (int)rint(xt-rx);
+ int w = (int)rint(xt+rx)-llx;
+ int lly = (int)rint(yt-ry);
+ int h = (int)rint(yt+ry)-lly;
+
+ if (what==POLYGON)
+ fl_pie(llx, lly, w, h, 0.0, 360.0);
+ else
+ fl_arc(llx, lly, w, h, 0.0, 360.0);
+}
+
+
#if 0
// Code used to switch output to an off-screen window. See macros in