summaryrefslogtreecommitdiffstats
path: root/src/selcue.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2009-12-21 16:37:12 +0000
committerTed Gould <ted@gould.cx>2009-12-21 16:37:12 +0000
commit752a8f90d3442cdaa4689ba6de4b911ca4fda514 (patch)
tree5e0739ec9bd2ac9cbdd2a2343859f89e02dae181 /src/selcue.cpp
parentMerging in from trunk (diff)
parentUpdating the READMEs to better handle OSX. (diff)
downloadinkscape-752a8f90d3442cdaa4689ba6de4b911ca4fda514.tar.gz
inkscape-752a8f90d3442cdaa4689ba6de4b911ca4fda514.zip
Updating to current trunk
(bzr r8254.1.38)
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);
+ }
}
}