From f12da8471875838ac6cf1f8c8db16637cb97c200 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Tue, 17 Apr 2007 21:26:43 +0000 Subject: Improve snapper performance (mainly in by editting WillSnapSomething()) (bzr r2917) --- src/guide-snapper.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/guide-snapper.cpp') diff --git a/src/guide-snapper.cpp b/src/guide-snapper.cpp index a05ecd3e6..9fd13705c 100644 --- a/src/guide-snapper.cpp +++ b/src/guide-snapper.cpp @@ -26,7 +26,7 @@ Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(NR::Point { LineList s; - if ( NULL == _named_view ) { + if ( NULL == _named_view || willSnapSomething() == false) { return s; } @@ -44,6 +44,14 @@ Inkscape::GuideSnapper::LineList Inkscape::GuideSnapper::_getSnapLines(NR::Point return s; } +/** + * \return true if this Snapper will snap at least one kind of point. + */ +bool Inkscape::GuideSnapper::willSnapSomething() const +{ + return _named_view == NULL ? false : (_enabled && _snap_to != 0 && _named_view->showguides); +} + /* Local Variables: mode:c++ -- cgit v1.2.3