From a5ae9e78dee836a41086f9419d018e16cbb58a15 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Tue, 10 Nov 2009 16:43:02 +0000 Subject: [PATCH] Fixed issue 325: Finishing an open path - Ghost segment git-svn-id: http://svg-edit.googlecode.com/svn/branches/transformlist@925 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 90e321f5..5d50a63a 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -3062,6 +3062,11 @@ function BatchCommand(text) { } segLine.setAttribute('display','inline'); + if(current_path_pt+1 >= current_path.pathSegList.numberOfItems) { + segLine.setAttribute('display','none'); + return; + } + if(!next_node) { // Replace "M" val replacePathSeg(2, 0, getPathPoint(current_path_pt, true), segLine); @@ -3186,7 +3191,6 @@ function BatchCommand(text) { if (grip) { grip.setAttribute("cx", mouse_x); grip.setAttribute("cy", mouse_y); - if(is_closed && is_first) { var grip = document.getElementById("pathpointgrip_" + last_index); grip.setAttribute("cx", mouse_x); @@ -3202,9 +3206,12 @@ function BatchCommand(text) { var id2 = (num-1)+'c2'; var line = document.getElementById("ctrlLine_"+id2); if(line) { - var x2 = line.getAttribute('x2') - 0 + x_diff*current_zoom; - var y2 = line.getAttribute('y2') - 0 + y_diff*current_zoom; - addControlPointGrip(x2,y2, mouse_x,mouse_y, id2, true); + // Don't do if first point on open path + if(!(!is_closed && current_path_pt_drag == 0)) { + var x2 = line.getAttribute('x2') - 0 + x_diff*current_zoom; + var y2 = line.getAttribute('y2') - 0 + y_diff*current_zoom; + addControlPointGrip(x2,y2, mouse_x,mouse_y, id2, true); + } } }