aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-05-12 12:52:51 +1000
committernyamatongwe <devnull@localhost>2011-05-12 12:52:51 +1000
commite32300e79413331a2be14db615775b929e624c4c (patch)
tree8a0e300bc1d6dccea8236363a680a233e20332dc
parent83579011c5b721c7c23e665bff23fac0a48147cc (diff)
downloadscintilla-mirror-e32300e79413331a2be14db615775b929e624c4c.tar.gz
Make rounded rectangle work on Cairo versions before 1.2.
-rw-r--r--gtk/PlatGTK.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 8359f4db9..c94847825 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -1242,7 +1242,12 @@ void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAl
static void PathRoundRectangle(cairo_t *context, double left, double top, double width, double height, int radius) {
double degrees = M_PI / 180.0;
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
cairo_new_sub_path(context);
+#else
+ // First arc is in the top-right corner and starts from a point on the top line
+ cairo_move_to(context, left + width - radius, top);
+#endif
cairo_arc(context, left + width - radius, top + radius, radius, -90 * degrees, 0 * degrees);
cairo_arc(context, left + width - radius, top + height - radius, radius, 0 * degrees, 90 * degrees);
cairo_arc(context, left + radius, top + height - radius, radius, 90 * degrees, 180 * degrees);