summaryrefslogtreecommitdiffstats
path: root/src/module.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-03-30 20:12:48 +0000
committerDavid Robillard <d@drobilla.net>2014-03-30 20:12:48 +0000
commite477fba7331b8a874b00a567defb09a888590aea (patch)
treea9a1626aae2137072e42fe48779f0b43f8d0c42d /src/module.c
parent7bf9f530dbdfcaa8151424908d492ef7c6c05e79 (diff)
downloadganv-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/module.c')
-rw-r--r--src/module.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/module.c b/src/module.c
index 5434fc8..c8da4d2 100644
--- a/src/module.c
+++ b/src/module.c
@@ -564,34 +564,32 @@ ganv_module_update(GanvItem* item, int flags)
static void
ganv_module_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)
{
GanvNode* node = GANV_NODE(item);
GanvModule* module = GANV_MODULE(item);
// Draw box
if (GANV_ITEM_CLASS(parent_class)->draw) {
- (*GANV_ITEM_CLASS(parent_class)->draw)(item, cr, cx, cy, width, height);
+ (*GANV_ITEM_CLASS(parent_class)->draw)(item, cr, cx, cy, cw, ch);
}
// Draw label
if (node->impl->label) {
GanvItem* label_item = GANV_ITEM(node->impl->label);
- GANV_ITEM_GET_CLASS(label_item)->draw(label_item, cr, cx, cy, width, height);
+ GANV_ITEM_GET_CLASS(label_item)->draw(label_item, cr, cx, cy, cw, ch);
}
// Draw ports
FOREACH_PORT(module->impl->ports, p) {
GANV_ITEM_GET_CLASS(GANV_ITEM(*p))->draw(
- GANV_ITEM(*p), cr, cx, cy, width, height);
+ GANV_ITEM(*p), cr, cx, cy, cw, ch);
}
// Draw embed item
if (module->impl->embed_item) {
GANV_ITEM_GET_CLASS(module->impl->embed_item)->draw(
- module->impl->embed_item, cr, cx, cy, width, height);
+ module->impl->embed_item, cr, cx, cy, cw, ch);
}
}
@@ -626,15 +624,11 @@ ganv_module_move(GanvNode* node,
}
static double
-ganv_module_point(GanvItem* item,
- double x, double y,
- int cx, int cy,
- GanvItem** actual_item)
+ganv_module_point(GanvItem* item, double x, double y, GanvItem** actual_item)
{
GanvModule* module = GANV_MODULE(item);
- double d = GANV_ITEM_CLASS(parent_class)->point(
- item, x, y, cx, cy, actual_item);
+ double d = GANV_ITEM_CLASS(parent_class)->point(item, x, y, actual_item);
if (!*actual_item) {
// Point is not inside module at all, no point in checking children
@@ -646,10 +640,7 @@ ganv_module_point(GanvItem* item,
*actual_item = NULL;
d = GANV_ITEM_GET_CLASS(port)->point(
- port,
- x - port->x, y - port->y,
- cx, cy,
- actual_item);
+ port, x - port->x, y - port->y, actual_item);
if (*actual_item) {
// Point is inside a port