summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2012-05-28 07:27:39 +0000
committerJon A. Cruz <jon@joncruz.org>2012-05-28 07:27:39 +0000
commite9cec1110c7abef2d7c89161ca07d2819a7bdff1 (patch)
tree35b594de2d302f580516a361ee026bc9c2ecb6d2 /src/display
parentStop using deprecated GdkBitmap in custom cursors (diff)
downloadinkscape-e9cec1110c7abef2d7c89161ca07d2819a7bdff1.tar.gz
inkscape-e9cec1110c7abef2d7c89161ca07d2819a7bdff1.zip
Cleanup of measure text for moving away from overlap.
(bzr r11430)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/canvas-text.cpp5
-rw-r--r--src/display/canvas-text.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/display/canvas-text.cpp b/src/display/canvas-text.cpp
index f7a8713b6..c7ca4ab16 100644
--- a/src/display/canvas-text.cpp
+++ b/src/display/canvas-text.cpp
@@ -255,8 +255,7 @@ sp_canvastext_update (SPCanvasItem *item, Geom::Affine const &affine, unsigned i
item->canvas->requestRedraw((int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
}
-SPCanvasItem *
-sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *new_text)
+SPCanvasText *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *new_text)
{
// Pos specifies the position of the anchor, which is at the bounding box of the text itself (i.e. not at the border of the filled background rectangle)
// The relative position of the anchor can be set using e.g. anchor_position = TEXT_ANCHOR_LEFT
@@ -270,7 +269,7 @@ sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gc
g_free(ct->text);
ct->text = g_strdup(new_text);
- return item;
+ return ct;
}
diff --git a/src/display/canvas-text.h b/src/display/canvas-text.h
index ecdb77f1c..b779d7170 100644
--- a/src/display/canvas-text.h
+++ b/src/display/canvas-text.h
@@ -58,7 +58,7 @@ struct SPCanvasTextClass : public SPCanvasItemClass{};
GType sp_canvastext_get_type (void);
-SPCanvasItem *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *text);
+SPCanvasText *sp_canvastext_new(SPCanvasGroup *parent, SPDesktop *desktop, Geom::Point pos, gchar const *text);
void sp_canvastext_set_rgba32 (SPCanvasText *ct, guint32 rgba, guint32 rgba_stroke);
void sp_canvastext_set_coords (SPCanvasText *ct, gdouble x0, gdouble y0);