diff options
author | David Robillard <d@drobilla.net> | 2013-12-31 00:02:43 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-12-31 00:02:43 +0000 |
commit | 176839c67d92ffa4207d9aeddba5573c388d5c62 (patch) | |
tree | d1993a045336d102d376440afc6b2e1354496c24 /src/canvas-base.c | |
parent | 8a9ac26d6ac67a3636b2f763eb252f9ad4f8b61a (diff) | |
download | ganv-176839c67d92ffa4207d9aeddba5573c388d5c62.tar.gz ganv-176839c67d92ffa4207d9aeddba5573c388d5c62.tar.bz2 ganv-176839c67d92ffa4207d9aeddba5573c388d5c62.zip |
Fix incorrect port offsets.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5232 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/canvas-base.c')
-rw-r--r-- | src/canvas-base.c | 52 |
1 files changed, 7 insertions, 45 deletions
diff --git a/src/canvas-base.c b/src/canvas-base.c index 662aab6..afd81b6 100644 --- a/src/canvas-base.c +++ b/src/canvas-base.c @@ -415,62 +415,24 @@ ganv_item_lower(GanvItem* item) --item->layer; } -gboolean -ganv_item_move_update(GanvItem* item, double dx, double dy, gboolean update) -{ - if (item == NULL || !GANV_IS_ITEM(item)) { - return FALSE; - } - - const double old_x = item->x; - const double old_y = item->y; - - item->x += dx; - item->y += dy; - - static const double MIN_COORD = 4.0; - if (item->x < MIN_COORD) { - item->x = MIN_COORD; - } - if (item->y < MIN_COORD) { - item->y = MIN_COORD; - } - - const gboolean moved = (lrint(old_x) != lrint(item->x) || - lrint(old_y) != lrint(item->y)); - - if (update) { - ganv_item_request_update(item); - item->canvas->need_repick = TRUE; - } - - return moved; -} - /** * ganv_item_move: * @item: A canvas item. * @dx: Horizontal offset. * @dy: Vertical offset. **/ -gboolean +void ganv_item_move(GanvItem* item, double dx, double dy) { - const double old_x = item->x; - const double old_y = item->y; - - if (!ganv_item_move_update(item, dx, dy, FALSE)) { - return FALSE; + if (!item || !GANV_IS_ITEM(item)) { + return; } - if (lrint(old_x) != lrint(item->x) || - lrint(old_y) != lrint(item->y)) { - ganv_item_request_update(item); - item->canvas->need_repick = TRUE; - return TRUE; - } + item->x += dx; + item->y += dy; - return FALSE; + ganv_item_request_update(item); + item->canvas->need_repick = TRUE; } /** |