summaryrefslogtreecommitdiffstats
path: root/src/selcue.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2009-12-13 13:00:22 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2009-12-13 13:00:22 +0000
commitda49b977d3a7e002c88780c24d9c4020cbe80b0e (patch)
tree9b8013d89cac18fd774622911a140ca1d13f0baf /src/selcue.cpp
parentReenable new input device dialog for further development (diff)
downloadinkscape-da49b977d3a7e002c88780c24d9c4020cbe80b0e.tar.gz
inkscape-da49b977d3a7e002c88780c24d9c4020cbe80b0e.zip
Position of baseline anchor is now dependent of the text alignment
Fixed bugs: - https://launchpad.net/bugs/168329 (bzr r8887)
Diffstat (limited to 'src/selcue.cpp')
-rw-r--r--src/selcue.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/selcue.cpp b/src/selcue.cpp
index 714daaa7e..8756524dd 100644
--- a/src/selcue.cpp
+++ b/src/selcue.cpp
@@ -181,18 +181,20 @@ void Inkscape::SelCue::_newTextBaselines()
if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item)) { // visualize baseline
Inkscape::Text::Layout const *layout = te_get_layout(item);
if (layout != NULL && layout->outputExists()) {
- Geom::Point a = layout->characterAnchorPoint(layout->begin()) * sp_item_i2d_affine(item);
- baseline_point = sp_canvas_item_new(sp_desktop_controls(_desktop), SP_TYPE_CTRL,
- "mode", SP_CTRL_MODE_XOR,
- "size", 4.0,
- "filled", 0,
- "stroked", 1,
- "stroke_color", 0x000000ff,
- NULL);
-
- sp_canvas_item_show(baseline_point);
- SP_CTRL(baseline_point)->moveto(a);
- sp_canvas_item_move_to_z(baseline_point, 0);
+ boost::optional<Geom::Point> pt = layout->baselineAnchorPoint();
+ if (pt) {
+ baseline_point = sp_canvas_item_new(sp_desktop_controls(_desktop), SP_TYPE_CTRL,
+ "mode", SP_CTRL_MODE_XOR,
+ "size", 4.0,
+ "filled", 0,
+ "stroked", 1,
+ "stroke_color", 0x000000ff,
+ NULL);
+
+ sp_canvas_item_show(baseline_point);
+ SP_CTRL(baseline_point)->moveto((*pt) * sp_item_i2d_affine(item));
+ sp_canvas_item_move_to_z(baseline_point, 0);
+ }
}
}