From: cilix42 Date: Mon, 19 May 2008 16:02:19 +0000 (+0000) Subject: Make LPEPerpBisector use the new nearest_point() function from point to line X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3183d5d3f14229a36961badd3bc9babc84ee6ec7;p=inkscape.git Make LPEPerpBisector use the new nearest_point() function from point to line --- diff --git a/src/live_effects/lpe-perp_bisector.cpp b/src/live_effects/lpe-perp_bisector.cpp index 2fec63f3c..b31ad6696 100644 --- a/src/live_effects/lpe-perp_bisector.cpp +++ b/src/live_effects/lpe-perp_bisector.cpp @@ -46,10 +46,7 @@ bisector_end_set(SPItem *item, NR::Point const &p, bool left) { Inkscape::LivePathEffect::LPEPerpBisector *lpe = (Inkscape::LivePathEffect::LPEPerpBisector *) sp_lpe_item_get_livepatheffect(SP_LPE_ITEM(item)); - Geom::Point v(Geom::unit_vector(lpe->B - lpe->A)); - Geom::Point diff(lpe->M - p.to_2geom()); - - double lambda = - v[Geom::Y] * diff[Geom::X] + v[Geom::X] * diff[Geom::Y]; + double lambda = Geom::nearest_point(p.to_2geom(), lpe->M, lpe->perp_dir); if (left) { lpe->C = lpe->M + lpe->perp_dir * lambda; lpe->length_left.param_set_value(lambda);