Commit 41c338ce authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

app: remove XOR drawing code paths which are now dead

parent 3afd2da6
......@@ -257,7 +257,6 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
switch (style)
{
case GIMP_CANVAS_STYLE_XOR_DOTTED:
case GIMP_CANVAS_STYLE_XOR_DASHED:
mask |= GDK_GC_LINE_STYLE;
values.line_style = GDK_LINE_ON_OFF_DASH;
/* fallthrough */
......@@ -293,7 +292,6 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
return gc;
case GIMP_CANVAS_STYLE_XOR_DOTTED:
case GIMP_CANVAS_STYLE_XOR_DASHED:
case GIMP_CANVAS_STYLE_XOR:
break;
}
......@@ -456,32 +454,6 @@ gimp_canvas_draw_arc (GimpCanvas *canvas,
filled, x, y, width, height, angle1, angle2);
}
/**
* gimp_canvas_draw_polygon:
* @canvas: a #GimpCanvas widget
* @style: one of the enumerated #GimpCanvasStyle's.
* @filled: if %TRUE, fill the polygon.
* @points: a #GdkPoint array.
* @num_points: the number of points in the array.
*
* Draws a polygon connecting the specified points, in the specified
* style.
**/
void
gimp_canvas_draw_polygon (GimpCanvas *canvas,
GimpCanvasStyle style,
gboolean filled,
GdkPoint *points,
gint num_points)
{
if (! gimp_canvas_ensure_style (canvas, style))
return;
gdk_draw_polygon (gtk_widget_get_window (GTK_WIDGET (canvas)),
canvas->gc[style],
filled, points, num_points);
}
/**
* gimp_canvas_draw_segments:
* @canvas: a #GimpCanvas widget
......
......@@ -25,7 +25,6 @@
typedef enum
{
GIMP_CANVAS_STYLE_XOR,
GIMP_CANVAS_STYLE_XOR_DASHED,
GIMP_CANVAS_STYLE_XOR_DOTTED,
GIMP_CANVAS_NUM_STYLES
} GimpCanvasStyle;
......@@ -103,11 +102,6 @@ void gimp_canvas_draw_arc (GimpCanvas *canvas,
gint height,
gint angle1,
gint angle2);
void gimp_canvas_draw_polygon (GimpCanvas *canvas,
GimpCanvasStyle style,
gboolean filled,
GdkPoint *points,
gint num_points);
void gimp_canvas_draw_segments (GimpCanvas *canvas,
GimpCanvasStyle style,
GdkSegment *segments,
......
......@@ -507,37 +507,14 @@ gimp_draw_tool_draw_dashed_line (GimpDrawTool *draw_tool,
gdouble x2,
gdouble y2)
{
GimpDisplayShell *shell;
gdouble tx1, ty1;
gdouble tx2, ty2;
GimpCanvasItem *item;
g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
if (draw_tool->use_cairo)
{
GimpCanvasItem *item;
item = gimp_canvas_line_new (x1, y1, x2, y2);
gimp_canvas_item_set_highlight (item, TRUE);
draw_tool->items = g_list_append (draw_tool->items, item);
item = gimp_canvas_line_new (x1, y1, x2, y2);
gimp_canvas_item_set_highlight (item, TRUE);
return;
}
shell = gimp_display_get_shell (draw_tool->display);
gimp_display_shell_transform_xy_f (shell,
x1, y1,
&tx1, &ty1);
gimp_display_shell_transform_xy_f (shell,
x2, y2,
&tx2, &ty2);
gimp_canvas_draw_line (GIMP_CANVAS (shell->canvas),
GIMP_CANVAS_STYLE_XOR_DASHED,
PROJ_ROUND (tx1), PROJ_ROUND (ty1),
PROJ_ROUND (tx2), PROJ_ROUND (ty2));
draw_tool->items = g_list_append (draw_tool->items, item);
}
/**
......@@ -553,48 +530,13 @@ gimp_draw_tool_draw_guide_line (GimpDrawTool *draw_tool,
GimpOrientationType orientation,
gint position)
{
GimpDisplayShell *shell;
gint x1, y1, x2, y2;
gint x, y;
GimpCanvasItem *item;
g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
if (draw_tool->use_cairo)
{
GimpCanvasItem *item;
item = gimp_canvas_guide_new (orientation, position);
draw_tool->items = g_list_append (draw_tool->items, item);
return;
}
shell = gimp_display_get_shell (draw_tool->display);
x1 = 0;
y1 = 0;
gdk_drawable_get_size (gtk_widget_get_window (shell->canvas), &x2, &y2);
switch (orientation)
{
case GIMP_ORIENTATION_HORIZONTAL:
gimp_display_shell_transform_xy (shell, 0, position, &x, &y);
y1 = y2 = y;
break;
case GIMP_ORIENTATION_VERTICAL:
gimp_display_shell_transform_xy (shell, position, 0, &x, &y);
x1 = x2 = x;
break;
case GIMP_ORIENTATION_UNKNOWN:
return;
}
item = gimp_canvas_guide_new (orientation, position);
gimp_canvas_draw_line (GIMP_CANVAS (shell->canvas), GIMP_CANVAS_STYLE_XOR,
x1, y1, x2, y2);
draw_tool->items = g_list_append (draw_tool->items, item);
}
/**
......@@ -1371,46 +1313,16 @@ gimp_draw_tool_draw_lines (GimpDrawTool *draw_tool,
gint n_points,
gboolean filled)
{
GimpDisplayShell *shell;
GdkPoint *coords;
GimpCanvasItem *item;
g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
if (points == NULL || n_points < 2)
return;
if (draw_tool->use_cairo)
{
GimpCanvasItem *item;
item = gimp_canvas_polygon_new (points, n_points, filled);
draw_tool->items = g_list_append (draw_tool->items, item);
return;
}
shell = gimp_display_get_shell (draw_tool->display);
coords = g_new (GdkPoint, n_points);
gimp_display_shell_transform_points (shell,
points, coords, n_points);
if (filled)
{
gimp_canvas_draw_polygon (GIMP_CANVAS (shell->canvas),
GIMP_CANVAS_STYLE_XOR,
TRUE, coords, n_points);
}
else
{
gimp_canvas_draw_lines (GIMP_CANVAS (shell->canvas),
GIMP_CANVAS_STYLE_XOR,
coords, n_points);
}
item = gimp_canvas_polygon_new (points, n_points, filled);
g_free (coords);
draw_tool->items = g_list_append (draw_tool->items, item);
}
void
......@@ -1419,46 +1331,16 @@ gimp_draw_tool_draw_strokes (GimpDrawTool *draw_tool,
gint n_points,
gboolean filled)
{
GimpDisplayShell *shell;
GdkPoint *coords;
GimpCanvasItem *item;
g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
if (points == NULL || n_points < 2)
return;
if (draw_tool->use_cairo)
{
GimpCanvasItem *item;
item = gimp_canvas_polygon_new_from_coords (points, n_points, filled);
draw_tool->items = g_list_append (draw_tool->items, item);
return;
}
shell = gimp_display_get_shell (draw_tool->display);
coords = g_new (GdkPoint, n_points);
gimp_display_shell_transform_coords (shell,
points, coords, n_points);
if (filled)
{
gimp_canvas_draw_polygon (GIMP_CANVAS (shell->canvas),
GIMP_CANVAS_STYLE_XOR,
TRUE, coords, n_points);
}
else
{
gimp_canvas_draw_lines (GIMP_CANVAS (shell->canvas),
GIMP_CANVAS_STYLE_XOR,
coords, n_points);
}
item = gimp_canvas_polygon_new_from_coords (points, n_points, filled);
g_free (coords);
draw_tool->items = g_list_append (draw_tool->items, item);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment