[gtk+] Fix handling of junctions in frame drawing code



commit 30fe4487506d2a90ddf9feef9708a96e925e3833
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Nov 23 16:13:15 2010 -0500

    Fix handling of junctions in frame drawing code

 gtk/gtkthemingengine.c |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index d1f9550..c3e1924 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -1206,8 +1206,7 @@ _cairo_round_rectangle_sides (cairo_t          *cr,
   if (sides & SIDE_RIGHT)
     {
       if (radius == 0 ||
-          (junction & GTK_JUNCTION_TOP) ||
-          (junction & GTK_JUNCTION_RIGHT))
+          (junction & GTK_JUNCTION_CORNER_TOPRIGHT))
         cairo_move_to (cr, x + width, y);
       else
         {
@@ -1216,8 +1215,7 @@ _cairo_round_rectangle_sides (cairo_t          *cr,
         }
 
       if (radius == 0 ||
-          (junction & GTK_JUNCTION_BOTTOM) ||
-          (junction & GTK_JUNCTION_RIGHT))
+          (junction & GTK_JUNCTION_CORNER_BOTTOMRIGHT))
         cairo_line_to (cr, x + width, y + height);
       else
         cairo_arc (cr, x + width - radius, y + height - radius, radius, 0, G_PI / 4);
@@ -1226,8 +1224,7 @@ _cairo_round_rectangle_sides (cairo_t          *cr,
   if (sides & SIDE_BOTTOM)
     {
       if (radius != 0 &&
-          ! (junction & GTK_JUNCTION_RIGHT) &&
-          ! (junction & GTK_JUNCTION_BOTTOM))
+          ! (junction & GTK_JUNCTION_CORNER_BOTTOMRIGHT))
         {
           if ((sides & SIDE_RIGHT) == 0)
             cairo_new_sub_path (cr);
@@ -1238,8 +1235,7 @@ _cairo_round_rectangle_sides (cairo_t          *cr,
         cairo_move_to (cr, x + width, y + height);
 
       if (radius == 0 ||
-          (junction & GTK_JUNCTION_BOTTOM) ||
-          (junction & GTK_JUNCTION_LEFT))
+          (junction & GTK_JUNCTION_CORNER_BOTTOMLEFT))
         cairo_line_to (cr, x, y + height);
       else
         cairo_arc (cr, x + radius, y + height - radius, radius, G_PI / 2, 3 * (G_PI / 4));
@@ -1250,8 +1246,7 @@ _cairo_round_rectangle_sides (cairo_t          *cr,
   if (sides & SIDE_LEFT)
     {
       if (radius != 0 &&
-          ! (junction & GTK_JUNCTION_LEFT) &&
-          ! (junction & GTK_JUNCTION_BOTTOM))
+          ! (junction & GTK_JUNCTION_CORNER_BOTTOMLEFT))
         {
           if ((sides & SIDE_BOTTOM) == 0)
             cairo_new_sub_path (cr);
@@ -1262,8 +1257,7 @@ _cairo_round_rectangle_sides (cairo_t          *cr,
         cairo_move_to (cr, x, y + height);
 
       if (radius == 0 ||
-          (junction & GTK_JUNCTION_TOP) ||
-          (junction & GTK_JUNCTION_LEFT))
+          (junction & GTK_JUNCTION_CORNER_TOPLEFT))
         cairo_line_to (cr, x, y);
       else
         cairo_arc (cr, x + radius, y + radius, radius, G_PI, G_PI + G_PI / 4);
@@ -1272,8 +1266,7 @@ _cairo_round_rectangle_sides (cairo_t          *cr,
   if (sides & SIDE_TOP)
     {
       if (radius != 0 &&
-          ! (junction & GTK_JUNCTION_TOP) &&
-          ! (junction & GTK_JUNCTION_LEFT))
+          ! (junction & GTK_JUNCTION_CORNER_TOPLEFT))
         {
           if ((sides & SIDE_LEFT) == 0)
             cairo_new_sub_path (cr);
@@ -1284,8 +1277,7 @@ _cairo_round_rectangle_sides (cairo_t          *cr,
         cairo_move_to (cr, x, y);
 
       if (radius == 0 ||
-          (junction & GTK_JUNCTION_TOP) ||
-          (junction & GTK_JUNCTION_RIGHT))
+          (junction & GTK_JUNCTION_CORNER_TOPRIGHT))
         cairo_line_to (cr, x + width, y);
       else
         cairo_arc (cr, x + width - radius, y + radius, radius, 3 * (G_PI / 2), - G_PI / 4);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]