aboutsummaryrefslogtreecommitdiff
path: root/src/tool_image.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-10-13 23:45:18 +0200
committerThomas White <taw@bitwiz.org.uk>2011-10-13 23:45:18 +0200
commitf663680514da83368464df0020d9c2e04ef770c8 (patch)
treebd93db3eb900665e6a07c1edb1e4186798f62c18 /src/tool_image.c
parent2e0f09d78f28c576d9a10dfcd1eeaae81e3baa07 (diff)
Check object type before asking the tool to do things
Diffstat (limited to 'src/tool_image.c')
-rw-r--r--src/tool_image.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tool_image.c b/src/tool_image.c
index af4ada5..2341dff 100644
--- a/src/tool_image.c
+++ b/src/tool_image.c
@@ -286,6 +286,13 @@ static void im_commit(struct object *o, gchar *str, struct toolinfo *tip)
}
+static int valid_object(struct object *o)
+{
+ if ( o->type == IMAGE ) return 1;
+ return 0;
+}
+
+
struct toolinfo *initialise_image_tool()
{
struct image_toolinfo *ti;
@@ -302,6 +309,7 @@ struct toolinfo *initialise_image_tool()
ti->base.draw_editing_overlay = draw_overlay;
ti->base.key_pressed = key_pressed;
ti->base.im_commit = im_commit;
+ ti->base.valid_object = valid_object;
return (struct toolinfo *)ti;
}