Fix handling of junctions in frame drawing code

This commit is contained in:
Matthias Clasen 2010-11-23 16:13:15 -05:00 committed by Carlos Garnacho
parent e522381183
commit 30fe448750

View File

@ -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);