Commit d66536fd authored by Christian Winter's avatar Christian Winter

bugfix. selection if vertex and edge are active

parent 59538b58
Pipeline #4620513 passed with stage
in 55 seconds
......@@ -116,13 +116,6 @@ class MouseHandler {
let lines = File.currentLayer.lines.concat(Selection.data.lines).concat(Selection.data.partialLines);
let pointsToChangeSelection = [];
if (Preferences.selectVertices) {
for (let p of Utilities.linesToLineEndings(lines)) {
if (Utilities.pointWithinCircle(p.position, mousePosition, cursorRange))
pointsToChangeSelection.push(p);
}
}
if (Preferences.selectEdges) {
for (let i = 0; i < lines.length; i++) {
if (Utilities.distancePointToLine(mousePosition, lines[i]) <= cursorRange) {
......@@ -130,8 +123,14 @@ class MouseHandler {
pointsToChangeSelection.push(lines[i].end);
}
}
} else if (Preferences.selectVertices) {
for (let p of Utilities.linesToLineEndings(lines)) {
if (Utilities.pointWithinCircle(p.position, mousePosition, cursorRange))
pointsToChangeSelection.push(p);
}
}
/*
// TODO weird number but should be a third?
let limit = 0.25;
......
......@@ -11,7 +11,14 @@
if (MouseHandler.LMBDown == true) {
let newSelPoints = [];
if (Preferences.selectVertices) {
if (Preferences.selectEdges) {
for (let line of File.currentLayer.lines.concat(Selection.data.partialLines)) {
if (Utilities.distancePointToLine(mousePosition, line) <= cursorRange) {
newSelPoints.push(line.start);
newSelPoints.push(line.end);
}
}
} else if (Preferences.selectVertices) {
for (let line of File.currentLayer.lines) {
if (Utilities.pointWithinCircle(line.start.position, mousePosition, cursorRange))
newSelPoints.push(line.start);
......@@ -25,21 +32,21 @@
newSelPoints.push(line.end);
}
}
if (Preferences.selectEdges) {
for (let line of File.currentLayer.lines.concat(Selection.data.partialLines)) {
if (Utilities.distancePointToLine(mousePosition, line) <= cursorRange) {
newSelPoints.push(line.start);
newSelPoints.push(line.end);
}
}
}
Selection.selectPoints(newSelPoints);
} else if (MouseHandler.MMBDown == true) {
let newUnselPoints = [];
if (Preferences.selectVertices) {
if (Preferences.selectEdges) {
for (let line of Selection.data.lines.concat(Selection.data.partialLines)) {
if (Utilities.distancePointToLine(mousePosition, line) <= cursorRange) {
newUnselPoints.push(line.start);
newUnselPoints.push(line.end);
}
}
}
else if (Preferences.selectVertices) {
for (let line of Selection.data.lines) {
if (Utilities.pointWithinCircle(line.start.position, mousePosition, cursorRange))
newUnselPoints.push(line.start);
......@@ -55,14 +62,7 @@
}
}
if (Preferences.selectEdges) {
for (let line of Selection.data.lines.concat(Selection.data.partialLines)) {
if (Utilities.distancePointToLine(mousePosition, line) <= cursorRange) {
newUnselPoints.push(line.start);
newUnselPoints.push(line.end);
}
}
}
Selection.deselectPoints(newUnselPoints);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment