summaryrefslogtreecommitdiffstats
path: root/src/text.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/text.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/text.c')
-rw-r--r--src/text.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/text.c b/src/text.c
index 3d3f938..c36aefa 100644
--- a/src/text.c
+++ b/src/text.c
@@ -233,26 +233,18 @@ ganv_text_bounds(GanvItem* item,
static void
ganv_text_update(GanvItem* item, int flags)
{
- double x1, y1, x2, y2;
- ganv_text_bounds(item, &x1, &y1, &x2, &y2);
- ganv_item_i2w_pair(item, &x1, &y1, &x2, &y2);
-
- // I have no idea why this is necessary
- item->x1 = x1;
- item->y1 = y1;
- item->x2 = x2;
- item->y2 = y2;
-
parent_class->update(item, flags);
- ganv_canvas_request_redraw(item->canvas, x1, y1, x2, y2);
+ // Update world-relative bounding box
+ ganv_text_bounds(item, &item->x1, &item->y1, &item->x2, &item->y2);
+ ganv_item_i2w_pair(item, &item->x1, &item->y1, &item->x2, &item->y2);
+
+ ganv_canvas_request_redraw_w(
+ item->canvas, item->x1, item->y1, item->x2, item->y2);
}
static double
-ganv_text_point(GanvItem* item,
- double x, double y,
- int cx, int cy,
- GanvItem** actual_item)
+ganv_text_point(GanvItem* item, double x, double y, GanvItem** actual_item)
{
*actual_item = NULL;
@@ -288,9 +280,7 @@ ganv_text_point(GanvItem* item,
static void
ganv_text_draw(GanvItem* item,
- cairo_t* cr,
- int x, int y,
- int width, int height)
+ cairo_t* cr, double cx, double cy, double cw, double ch)
{
GanvText* text = GANV_TEXT(item);
GanvTextImpl* impl = text->impl;