From 1b5ad44f5a431316b6f618a44320e22e5908abcb Mon Sep 17 00:00:00 2001 From: dvlierop2 Date: Fri, 27 Feb 2009 18:49:52 +0000 Subject: [PATCH] More accurate wording in snap tooltips --- src/display/snap-indicator.cpp | 18 ++++++++++++++++++ src/snapped-point.h | 10 ++++++++-- src/sp-ellipse.cpp | 2 +- src/sp-image.cpp | 2 +- src/sp-rect.cpp | 2 +- src/sp-text.cpp | 2 +- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp index b9f7ee1d4..a5d7b77f0 100644 --- a/src/display/snap-indicator.cpp +++ b/src/display/snap-indicator.cpp @@ -127,6 +127,15 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const p) case SNAPTARGET_ELLIPSE_QUADRANT_POINT: target_name = _("quadrant point"); break; + case SNAPTARGET_CENTER: + target_name = _("center"); + break; + case SNAPTARGET_CORNER: + target_name = _("corner"); + break; + case SNAPTARGET_TEXT_BASELINE: + target_name = _("text baseline"); + break; default: g_warning("Snap target has not yet been defined!"); break; @@ -176,6 +185,15 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const p) case SNAPSOURCE_ELLIPSE_QUADRANT_POINT: source_name = _("Quadrant point"); break; + case SNAPSOURCE_CENTER: + source_name = _("Center"); + break; + case SNAPSOURCE_CORNER: + source_name = _("Corner"); + break; + case SNAPSOURCE_TEXT_BASELINE: + source_name = _("Text baseline"); + break; default: g_warning("Snap source has not yet been defined!"); break; diff --git a/src/snapped-point.h b/src/snapped-point.h index f8ef50ff3..c0209c09d 100644 --- a/src/snapped-point.h +++ b/src/snapped-point.h @@ -33,7 +33,7 @@ enum SnapTargetType { SNAPTARGET_LINE_MIDPOINT, SNAPTARGET_OBJECT_MIDPOINT, SNAPTARGET_ROTATION_CENTER, - SNAPTARGET_HANDLE, //e.g. center of ellipse, corner of rectangle + SNAPTARGET_HANDLE, SNAPTARGET_PATH, SNAPTARGET_PATH_INTERSECTION, SNAPTARGET_BBOX_CORNER, @@ -45,6 +45,9 @@ enum SnapTargetType { SNAPTARGET_PAGE_CORNER, SNAPTARGET_CONVEX_HULL_CORNER, SNAPTARGET_ELLIPSE_QUADRANT_POINT, + SNAPTARGET_CENTER, // of ellipse + SNAPTARGET_CORNER, // of image or of rectangle + SNAPTARGET_TEXT_BASELINE }; enum SnapSourceType { @@ -61,7 +64,10 @@ enum SnapSourceType { SNAPSOURCE_PATH_INTERSECTION, SNAPSOURCE_GUIDE, SNAPSOURCE_CONVEX_HULL_CORNER, - SNAPSOURCE_ELLIPSE_QUADRANT_POINT + SNAPSOURCE_ELLIPSE_QUADRANT_POINT, + SNAPSOURCE_CENTER, // of ellipse + SNAPSOURCE_CORNER, // of image or of rectangle + SNAPSOURCE_TEXT_BASELINE }; diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index 8022be560..251620b6c 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -304,7 +304,7 @@ static void sp_genericellipse_snappoints(SPItem const *item, bool const target, // Add the centre, if we have a closed slice or when explicitly asked for if ((snapprefs->getSnapToItemNode() && slice && ellipse->closed) || snapprefs->getSnapObjectMidpoints()) { pt = Geom::Point(cx, cy) * i2d; - p.push_back(std::make_pair(pt, target ? int(Inkscape::SNAPTARGET_HANDLE) : int(Inkscape::SNAPSOURCE_HANDLE))); + p.push_back(std::make_pair(pt, target ? int(Inkscape::SNAPTARGET_CENTER) : int(Inkscape::SNAPSOURCE_CENTER))); } // And if we have a slice, also snap to the endpoints diff --git a/src/sp-image.cpp b/src/sp-image.cpp index 49350bd69..c99e1e0f7 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -1330,7 +1330,7 @@ static void sp_image_snappoints(SPItem const *item, bool const target, SnapPoint double const y1 = y0 + image.height.computed; Geom::Matrix const i2d (sp_item_i2d_affine (item)); Geom::Point pt; - int type = target ? int(Inkscape::SNAPTARGET_HANDLE) : int(Inkscape::SNAPSOURCE_HANDLE); + int type = target ? int(Inkscape::SNAPTARGET_CORNER) : int(Inkscape::SNAPSOURCE_CORNER); p.push_back(std::make_pair(Geom::Point(x0, y0) * i2d, type)); p.push_back(std::make_pair(Geom::Point(x0, y1) * i2d, type)); p.push_back(std::make_pair(Geom::Point(x1, y1) * i2d, type)); diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 4f8dbbbce..f59a02853 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -572,7 +572,7 @@ static void sp_rect_snappoints(SPItem const *item, bool const target, SnapPoints int type; if (snapprefs->getSnapToItemNode()) { - type = target ? int(Inkscape::SNAPTARGET_HANDLE) : int(Inkscape::SNAPSOURCE_HANDLE); + type = target ? int(Inkscape::SNAPTARGET_CORNER) : int(Inkscape::SNAPSOURCE_CORNER); p.push_back(std::make_pair(p0, type)); p.push_back(std::make_pair(p1, type)); p.push_back(std::make_pair(p2, type)); diff --git a/src/sp-text.cpp b/src/sp-text.cpp index 91a8a0361..61947311c 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -433,7 +433,7 @@ static void sp_text_snappoints(SPItem const *item, bool const target, SnapPoints // the baseline anchor of the first char Inkscape::Text::Layout const *layout = te_get_layout((SPItem *) item); if(layout != NULL) { - int type = target ? int(Inkscape::SNAPTARGET_HANDLE) : int(Inkscape::SNAPSOURCE_HANDLE); + int type = target ? int(Inkscape::SNAPTARGET_TEXT_BASELINE) : int(Inkscape::SNAPSOURCE_TEXT_BASELINE); p.push_back(std::make_pair(layout->characterAnchorPoint(layout->begin()) * sp_item_i2d_affine(item), type)); } } -- 2.30.2