app: don't "fix" the extents of filled rectangles and circles

Apply the fix for Xlib evilness (non-filled rectangles and circles are
drawn one pixel larger) only for non-filled things, filled drawing is
right by default.
This commit is contained in:
Michael Natterer 2010-02-21 20:41:48 +01:00
parent b6db793e6f
commit 7c63af506e
1 changed files with 15 additions and 3 deletions

View File

@ -552,12 +552,18 @@ gimp_draw_tool_draw_rectangle (GimpDrawTool *draw_tool,
w = PROJ_ROUND (MAX (0.0, tx2));
h = PROJ_ROUND (MAX (0.0, ty2));
if (! filled)
{
w--;
h--;
}
if (w > 0 && h > 0)
gimp_canvas_draw_rectangle (GIMP_CANVAS (shell->canvas),
GIMP_CANVAS_STYLE_XOR,
filled,
PROJ_ROUND (tx1), PROJ_ROUND (ty1),
w - 1, h - 1);
w, h);
}
void
@ -594,6 +600,12 @@ gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool,
w = PROJ_ROUND (MAX (0.0, tx2));
h = PROJ_ROUND (MAX (0.0, ty2));
if (! filled)
{
w--;
h--;
}
if (w > 0 && h > 0)
{
if (w != 1 && h != 1)
@ -602,7 +614,7 @@ gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool,
GIMP_CANVAS_STYLE_XOR,
filled,
PROJ_ROUND (tx1), PROJ_ROUND (ty1),
w - 1, h - 1,
w, h,
angle1, angle2);
}
else
@ -614,7 +626,7 @@ gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool,
GIMP_CANVAS_STYLE_XOR,
filled,
PROJ_ROUND (tx1), PROJ_ROUND (ty1),
w - 1, h - 1);
w, h);
}
}
}