summaryrefslogtreecommitdiffstats
path: root/src/draw-anchor.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2012-05-03 06:51:21 +0000
committerJon A. Cruz <jon@joncruz.org>2012-05-03 06:51:21 +0000
commit928e90577c43842f334fbe2361c45d92ed784dc3 (patch)
treefb8e333b43058dab91e832a7a50a0b28dbe2bc18 /src/draw-anchor.cpp
parentEliminated duplication of GTK key defines. (diff)
downloadinkscape-928e90577c43842f334fbe2361c45d92ed784dc3.tar.gz
inkscape-928e90577c43842f334fbe2361c45d92ed784dc3.zip
Corrected hardcoded hit detection in pen & pencil tool endpoint detection.
(bzr r11319)
Diffstat (limited to 'src/draw-anchor.cpp')
-rw-r--r--src/draw-anchor.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/draw-anchor.cpp b/src/draw-anchor.cpp
index c9bc5485e..62a091608 100644
--- a/src/draw-anchor.cpp
+++ b/src/draw-anchor.cpp
@@ -71,8 +71,6 @@ SPDrawAnchor *sp_draw_anchor_destroy(SPDrawAnchor *anchor)
return NULL;
}
-#define A_SNAP 4.0
-
/**
* Test if point is near anchor, if so fill anchor on canvas and return
* pointer to it or NULL.
@@ -80,8 +78,9 @@ SPDrawAnchor *sp_draw_anchor_destroy(SPDrawAnchor *anchor)
SPDrawAnchor *sp_draw_anchor_test(SPDrawAnchor *anchor, Geom::Point w, gboolean activate)
{
SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(anchor->dc);
+ SPCtrl *ctrl = SP_CTRL(anchor->ctrl);
- if ( activate && ( Geom::LInfty( w - dt->d2w(anchor->dp) ) <= A_SNAP ) ) {
+ if ( activate && ( Geom::LInfty( w - dt->d2w(anchor->dp) ) <= (ctrl->box.width() / 2.0) ) ) {
if (!anchor->active) {
sp_canvas_item_set((GtkObject *) anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, NULL);
anchor->active = TRUE;