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
master
Alexis Deveria 2009-11-10 16:43:02 +00:00
parent d7c3f73d02
commit a5ae9e78de
1 changed files with 11 additions and 4 deletions

View File

@ -3062,6 +3062,11 @@ function BatchCommand(text) {
} }
segLine.setAttribute('display','inline'); segLine.setAttribute('display','inline');
if(current_path_pt+1 >= current_path.pathSegList.numberOfItems) {
segLine.setAttribute('display','none');
return;
}
if(!next_node) { if(!next_node) {
// Replace "M" val // Replace "M" val
replacePathSeg(2, 0, getPathPoint(current_path_pt, true), segLine); replacePathSeg(2, 0, getPathPoint(current_path_pt, true), segLine);
@ -3186,7 +3191,6 @@ function BatchCommand(text) {
if (grip) { if (grip) {
grip.setAttribute("cx", mouse_x); grip.setAttribute("cx", mouse_x);
grip.setAttribute("cy", mouse_y); grip.setAttribute("cy", mouse_y);
if(is_closed && is_first) { if(is_closed && is_first) {
var grip = document.getElementById("pathpointgrip_" + last_index); var grip = document.getElementById("pathpointgrip_" + last_index);
grip.setAttribute("cx", mouse_x); grip.setAttribute("cx", mouse_x);
@ -3202,11 +3206,14 @@ function BatchCommand(text) {
var id2 = (num-1)+'c2'; var id2 = (num-1)+'c2';
var line = document.getElementById("ctrlLine_"+id2); var line = document.getElementById("ctrlLine_"+id2);
if(line) { if(line) {
// 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 x2 = line.getAttribute('x2') - 0 + x_diff*current_zoom;
var y2 = line.getAttribute('y2') - 0 + y_diff*current_zoom; var y2 = line.getAttribute('y2') - 0 + y_diff*current_zoom;
addControlPointGrip(x2,y2, mouse_x,mouse_y, id2, true); addControlPointGrip(x2,y2, mouse_x,mouse_y, id2, true);
} }
} }
}
if(next_type != 4) { if(next_type != 4) {
var id1 = (current_path_pt_drag)+'c1'; var id1 = (current_path_pt_drag)+'c1';