summaryrefslogtreecommitdiffstats
path: root/src/sp-flowtext.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-07-06 01:59:32 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-07-06 01:59:32 +0000
commite65a02ed32b78534739aba24929ece7c44dd967f (patch)
tree13cf022f18f6b5bae46aad4bc339e512f069a514 /src/sp-flowtext.cpp
parentPull 2Geom revision 2013 (extra constructors for Rect). (diff)
parentText edit dialog: Apply button should grab default only after adding to window (diff)
downloadinkscape-e65a02ed32b78534739aba24929ece7c44dd967f.tar.gz
inkscape-e65a02ed32b78534739aba24929ece7c44dd967f.zip
Merge from trunk
(bzr r10347.1.5)
Diffstat (limited to 'src/sp-flowtext.cpp')
-rw-r--r--src/sp-flowtext.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp
index 9db0d29b2..ab545919f 100644
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
@@ -391,15 +391,17 @@ static gchar *sp_flowtext_description(SPItem *item)
}
}
-static void sp_flowtext_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const */*snapprefs*/)
+static void sp_flowtext_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
{
- // Choose a point on the baseline for snapping from or to, with the horizontal position
- // of this point depending on the text alignment (left vs. right)
- Inkscape::Text::Layout const *layout = te_get_layout((SPItem *) item);
- if (layout != NULL && layout->outputExists()) {
- boost::optional<Geom::Point> pt = layout->baselineAnchorPoint();
- if (pt) {
- p.push_back(Inkscape::SnapCandidatePoint((*pt) * item->i2d_affine(), Inkscape::SNAPSOURCE_TEXT_BASELINE, Inkscape::SNAPTARGET_TEXT_BASELINE));
+ if (snapprefs->getSnapTextBaseline()) {
+ // Choose a point on the baseline for snapping from or to, with the horizontal position
+ // of this point depending on the text alignment (left vs. right)
+ Inkscape::Text::Layout const *layout = te_get_layout((SPItem *) item);
+ if (layout != NULL && layout->outputExists()) {
+ boost::optional<Geom::Point> pt = layout->baselineAnchorPoint();
+ if (pt) {
+ p.push_back(Inkscape::SnapCandidatePoint((*pt) * item->i2d_affine(), Inkscape::SNAPSOURCE_TEXT_ANCHOR, Inkscape::SNAPTARGET_TEXT_ANCHOR));
+ }
}
}
}