X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fobject-edit.cpp;h=2eabdd7bd480acd97a64789f9de6c635f38eb81d;hb=5e8a08857af3a55929109a0e6eaf5a149b4b6e1c;hp=3db0f0a21837122d2a181877110297054a19c70e;hpb=6b15695578f07a3f72c4c9475c1a261a3021472a;p=inkscape.git diff --git a/src/object-edit.cpp b/src/object-edit.cpp index 3db0f0a21..2eabdd7bd 100644 --- a/src/object-edit.cpp +++ b/src/object-edit.cpp @@ -29,6 +29,7 @@ #include "desktop-affine.h" #include #include "desktop.h" +#include "sp-namedview.h" #include "sp-pattern.h" #include "sp-path.h" @@ -227,12 +228,12 @@ static void sp_rect_rx_set(SPItem *item, NR::Point const &p, NR::Point const &or gdouble temp = MIN(rect->height.computed, rect->width.computed) / 2.0; rect->rx.computed = rect->ry.computed = CLAMP(rect->x.computed + rect->width.computed - p[NR::X], 0.0, temp); rect->rx._set = rect->ry._set = true; - + } else { rect->rx.computed = CLAMP(rect->x.computed + rect->width.computed - p[NR::X], 0.0, rect->width.computed / 2.0); rect->rx._set = true; } - + ((SPObject*)rect)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } @@ -248,7 +249,7 @@ static void sp_rect_ry_set(SPItem *item, NR::Point const &p, NR::Point const &or { SPRect *rect = SP_RECT(item); - if (state & GDK_CONTROL_MASK) { + if (state & GDK_CONTROL_MASK) { gdouble temp = MIN(rect->height.computed, rect->width.computed) / 2.0; rect->rx.computed = rect->ry.computed = CLAMP(p[NR::Y] - rect->y.computed, 0.0, temp); rect->ry._set = rect->rx._set = true; @@ -334,7 +335,7 @@ static NR::Point rect_snap_knot_position(NR::Point const &p) { SPDesktop const *desktop = inkscape_active_desktop(); NR::Point s = sp_desktop_dt2root_xy_point(desktop, p); - SnapManager const m(desktop->namedview); + SnapManager const &m = desktop->namedview->snap_manager; s = m.freeSnap(Inkscape::Snapper::BBOX_POINT | Inkscape::Snapper::SNAP_POINT, s, NULL).getPoint(); return sp_desktop_root2dt_xy_point(desktop, s); }