From d4056752d41865bf7b6890b14cbd00ae0fa1478f Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 1 Nov 2014 22:58:19 +0100 Subject: Fix a bug in perspective/envelope LPE, rendering points -handles- outside bounding box It affect to Envelope mode, sometimes give undesirable results, now fixed. (bzr r13655) --- src/live_effects/lpe-perspective-envelope.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp index 4d8c79198..0e620bc99 100644 --- a/src/live_effects/lpe-perspective-envelope.cpp +++ b/src/live_effects/lpe-perspective-envelope.cpp @@ -193,8 +193,8 @@ LPEPerspectiveEnvelope::project_point(Geom::Point p){ double height = boundingbox_Y.extent(); double delta_x = boundingbox_X.min() - p[X]; double delta_y = boundingbox_Y.max() - p[Y]; - Geom::Coord xratio = (delta_x * sgn(delta_x)) / width; - Geom::Coord yratio = (delta_y * sgn(delta_y)) / height; + Geom::Coord xratio = (delta_x * -1) / width; + Geom::Coord yratio = delta_y / height; Geom::Line* horiz = new Geom::Line(); Geom::Line* vert = new Geom::Line(); vert->setPoints (pointAtRatio(yratio,Down_Left_Point,Up_Left_Point),pointAtRatio(yratio,Down_Right_Point,Up_Right_Point)); -- cgit v1.2.3