summaryrefslogtreecommitdiffstats
path: root/src/display/snap-indicator.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-01-14 08:13:09 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-01-14 08:13:09 +0000
commit7f7da4643d6909af5cd58b2f24846774e3af509b (patch)
tree1fec13b3616ecc90fb251bb9e643aefc43c80c43 /src/display/snap-indicator.cpp
parentSome additional docs (diff)
parentInitial cut of disabling floating windows on window managers with problems. (diff)
downloadinkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.tar.gz
inkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.zip
* Merge from trunk
* Update to new snapping API * Modify the join action slightly (bzr r8846.2.11)
Diffstat (limited to 'src/display/snap-indicator.cpp')
-rw-r--r--src/display/snap-indicator.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp
index 20ea7d58c..84bc1709b 100644
--- a/src/display/snap-indicator.cpp
+++ b/src/display/snap-indicator.cpp
@@ -40,17 +40,16 @@ SnapIndicator::~SnapIndicator()
}
void
-SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const p)
+SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p)
{
remove_snaptarget(); //only display one snaptarget at a time
g_assert(_desktop != NULL);
- /* Commented out for now, because this might hide any snapping bug!
if (!p.getSnapped()) {
- return; // If we haven't snapped, then it is of no use to draw a snapindicator
+ g_warning("No snapping took place, so no snap target will be displayed");
+ return; // If we haven't snapped, then it is of no use to draw a snapindicator
}
- */
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
bool value = prefs->getBool("/options/snapindicator/value", true);
@@ -98,9 +97,6 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const p)
case SNAPTARGET_BBOX_EDGE:
target_name = _("bounding box side");
break;
- case SNAPTARGET_GRADIENTS_PARENT_BBOX:
- target_name = _("bounding box");
- break;
case SNAPTARGET_PAGE_BORDER:
target_name = _("page border");
break;
@@ -140,6 +136,9 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const p)
case SNAPTARGET_TEXT_BASELINE:
target_name = _("text baseline");
break;
+ case SNAPTARGET_CONSTRAINED_ANGLE:
+ target_name = _("constrained angle");
+ break;
default:
g_warning("Snap target has not yet been defined!");
break;
@@ -265,7 +264,7 @@ SnapIndicator::remove_snaptarget()
}
void
-SnapIndicator::set_new_snapsource(std::pair<Geom::Point, int> const p)
+SnapIndicator::set_new_snapsource(Inkscape::SnapCandidatePoint const &p)
{
remove_snapsource();
@@ -285,7 +284,7 @@ SnapIndicator::set_new_snapsource(std::pair<Geom::Point, int> const p)
"shape", SP_KNOT_SHAPE_CIRCLE,
NULL );
- SP_CTRL(canvasitem)->moveto(p.first);
+ SP_CTRL(canvasitem)->moveto(p.getPoint());
_snapsource = _desktop->add_temporary_canvasitem(canvasitem, 1000);
}
}