aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2011-05-12 12:52:51 +1000
committernyamatongwe <unknown>2011-05-12 12:52:51 +1000
commit0dba52ccbdc24e9f3eba9a2c258c52f4a4f0c32a (patch)
treee6c466203cee4f7e414cc678af9b3d8ed3b22c4e
parent3f7c041025a032be8a99f04bb5ebaaba0ef15d2e (diff)
downloadscintilla-mirror-0dba52ccbdc24e9f3eba9a2c258c52f4a4f0c32a.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);