Commit a27bb3d7 authored by Christian Winter's avatar Christian Winter

merge split and moved parts into selection class

parent cef68d97
Pipeline #5143089 passed with stage
in 40 seconds
......@@ -164,16 +164,11 @@ Utilities = new class {
return points;
}
// TODO make part of selection class?
mergeSelectedPoints() {
let selection = Application.currentView.selection;
let endings = selection.getAllSelectedPoints();
let center = this.calculateBBCenter(endings);
for (let ending of endings)
ending.position = center.copy();
mergePoints(points) {
let center = this.calculateBBCenter(points);
Application.redrawAllViews();
for (let p of points)
p.position = center.copy();
}
// TODO make it possible to pass in, position as Vector2 and rotate as angle
......
......@@ -170,6 +170,11 @@
Application.redrawAllViews();
}
merge() {
Utilities.mergePoints(this.data.getAllPositions())
Application.redrawAllViews();
}
moveBy(delta) {
let points = this.data.getAllPositions();
......@@ -181,4 +186,6 @@
rotate() {
}
}
\ No newline at end of file
......@@ -69,7 +69,7 @@
this.arrowMovement(0, 1, Input.isKeyDown(Key.Shift), Input.isKeyDown(Key.Control));
break;
case Key.M:
Utilities.mergeSelectedPoints();
Application.currentView.selection.merge();
break;
case Key.Z:
......
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