diff options
author | David Robillard <d@drobilla.net> | 2014-03-30 20:12:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-03-30 20:12:48 +0000 |
commit | e477fba7331b8a874b00a567defb09a888590aea (patch) | |
tree | a9a1626aae2137072e42fe48779f0b43f8d0c42d /src/box.c | |
parent | 7bf9f530dbdfcaa8151424908d492ef7c6c05e79 (diff) | |
download | ganv-e477fba7331b8a874b00a567defb09a888590aea.tar.gz ganv-e477fba7331b8a874b00a567defb09a888590aea.tar.bz2 ganv-e477fba7331b8a874b00a567defb09a888590aea.zip |
Reimplement canvas zoom.
Make select rectangle translucent.
Make ctrl+scroll wheel zoom, not change font size.
Add separate controls in Patchage for zoom (scale) and font size.
Banish canvas coordinates from item implementations.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5345 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/box.c')
-rw-r--r-- | src/box.c | 24 |
1 files changed, 7 insertions, 17 deletions
@@ -153,7 +153,7 @@ ganv_box_request_redraw(GanvItem* item, ganv_item_i2w_pair(item, &x1, &y1, &x2, &y2); } - ganv_canvas_request_redraw(item->canvas, x1, y1, x2, y2); + ganv_canvas_request_redraw_w(item->canvas, x1, y1, x2, y2); } static void @@ -192,14 +192,9 @@ ganv_box_update(GanvItem* item, int flags) ganv_box_normalize(box); - // Get bounding box - double x1, x2, y1, y2; - ganv_box_bounds(item, &x1, &y1, &x2, &y2); - ganv_item_i2w_pair(item, &x1, &y1, &x2, &y2); - - // Update item canvas coordinates - ganv_canvas_w2c_d(item->canvas, x1, y1, &item->x1, &item->y1); - ganv_canvas_w2c_d(item->canvas, x2, y2, &item->x2, &item->y2); + // Update world-relative bounding box + ganv_box_bounds(item, &item->x1, &item->y1, &item->x2, &item->y2); + ganv_item_i2w_pair(item, &item->x1, &item->y1, &item->x2, &item->y2); // Request redraw of new location ganv_box_request_redraw(item, &impl->coords, FALSE); @@ -207,9 +202,7 @@ ganv_box_update(GanvItem* item, int flags) static void ganv_box_draw(GanvItem* item, - cairo_t* cr, - int cx, int cy, - int width, int height) + cairo_t* cr, double cx, double cy, double cw, double ch) { GanvBox* box = GANV_BOX(item); GanvBoxImpl* impl = box->impl; @@ -275,14 +268,11 @@ ganv_box_draw(GanvItem* item, } GanvItemClass* item_class = GANV_ITEM_CLASS(parent_class); - item_class->draw(item, cr, cx, cy, width, height); + item_class->draw(item, cr, cx, cy, cw, ch); } static double -ganv_box_point(GanvItem* item, - double x, double y, - int cx, int cy, - GanvItem** actual_item) +ganv_box_point(GanvItem* item, double x, double y, GanvItem** actual_item) { GanvBox* box = GANV_BOX(item); GanvBoxImpl* impl = box->impl; |