From e477fba7331b8a874b00a567defb09a888590aea Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 30 Mar 2014 20:12:48 +0000 Subject: 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 --- src/port.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/port.c') diff --git a/src/port.c b/src/port.c index e6bf649..2f7b2b5 100644 --- a/src/port.c +++ b/src/port.c @@ -127,20 +127,18 @@ ganv_port_get_property(GObject* object, static void ganv_port_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) { GanvPort* port = GANV_PORT(item); GanvCanvas* canvas = GANV_CANVAS(item->canvas); // Draw Box 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); if (port->impl->control) { GanvItem* const rect = GANV_ITEM(port->impl->control->rect); - GANV_ITEM_GET_CLASS(rect)->draw(rect, cr, cx, cy, width, height); + GANV_ITEM_GET_CLASS(rect)->draw(rect, cr, cx, cy, cw, ch); } if (ganv_canvas_get_direction(canvas) == GANV_DIRECTION_DOWN || @@ -155,7 +153,7 @@ ganv_port_draw(GanvItem* item, for (int i = 0; i < 2; ++i) { if (labels[i] && (labels[i]->object.flags & GANV_ITEM_VISIBLE)) { GANV_ITEM_GET_CLASS(labels[i])->draw( - labels[i], cr, cx, cy, width, height); + labels[i], cr, cx, cy, cw, ch); } } } -- cgit v1.2.1