GtkThemingEngine: ensure 1px wide frames aren't painted between pixels.

This commit is contained in:
Carlos Garnacho 2010-11-08 20:17:17 +01:00
parent f66275fa6a
commit 0431239ead

View File

@ -1663,6 +1663,13 @@ gtk_theming_engine_render_frame (GtkThemingEngine *engine,
width -= border_width;
height -= border_width;
}
else if (border_width == 1)
{
x += 0.5;
y += 0.5;
width -= 1;
height -= 1;
}
_cairo_round_rectangle_sides (cr, (gdouble) radius, x, y, width, height,
SIDE_ALL, junction);
@ -1675,13 +1682,16 @@ gtk_theming_engine_render_frame (GtkThemingEngine *engine,
cairo_set_line_width (cr, border_width);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
d1 = d2 = 0;
if (border_width > 1)
{
d1 = (gdouble) border_width / 2;
d2 = (gdouble) (border_width - (gint) d1) + 1;
}
else
{
d1 = 0.5;
d2 = 1;
}
cairo_save (cr);