Commit 9593c10e authored by Christian Winter's avatar Christian Winter

noSelection renamed to isEmpty()

parent 4cccc61b
......@@ -445,7 +445,7 @@
}
break;
case Key.G:
if (!this.selection.noSelection()) {
if (!this.selection.isEmpty()) {
if (Input.isKeyDown(Key.Alt))
LineManipulator.resetPosition();
else
......@@ -454,7 +454,7 @@
}
break;
case Key.R:
if (!this.selection.noSelection()) {
if (!this.selection.isEmpty()) {
if (Input.isKeyDown(Key.Shift))
LineManipulator.rotateSelectionBy(90);
else if (Input.isKeyDown(Key.Control))
......@@ -469,7 +469,7 @@
case Key.S:
if (!Input.isKeyDown(Key.Control) && !Input.isKeyDown(Key.Shift))
if (!this.selection.noSelection()) {
if (!this.selection.isEmpty()) {
if (Input.isKeyDown(Key.Alt))
LineManipulator.resetScale();
else
......@@ -481,7 +481,7 @@
case Key.D:
if (Input.isKeyDown(Key.Shift)) {
if (this.logic.currentState instanceof IdleState || this.logic.currentState instanceof MoveLinesState) {
if (!this.selection.noSelection()) {
if (!this.selection.isEmpty()) {
this.selection.duplicate();
this.logic.setState(new MoveLinesState());
}
......@@ -548,7 +548,7 @@
case Key.D:
if (this.logic.currentState instanceof ContinousDrawingState) {
if (!this.logic.currentState.used && !this.selection.noSelection()) {
if (!this.logic.currentState.used && !this.selection.isEmpty()) {
this.selection.duplicate();
this.logic.setState(new MoveLinesState());
}
......
......@@ -36,8 +36,7 @@
this.data.changed();
}
// TODO rename isEmpty()
noSelection() {
isEmpty() {
return this.data.points.length == 0 && this.data.partialLines.length == 0 && this.data.lines.length == 0 && this.data.instances.length == 0;
}
......@@ -151,7 +150,7 @@
}
selectAllToggle() {
if (this.noSelection())
if (this.isEmpty())
this.selectEverything();
else
this.clear();
......
......@@ -40,7 +40,7 @@
Application.currentView.logic.setState(new MoveLinesState());
break;
case Key.X:
if (!Application.currentView.selection.noSelection()) {
if (!Application.currentView.selection.isEmpty()) {
if (Input.isKeyDown(Key.Control))
Saver.copyLinesToClipboard();
......@@ -50,7 +50,7 @@
break;
case Key.Delete:
case Key.Backspace:
if (!Application.currentView.selection.noSelection()) {
if (!Application.currentView.selection.isEmpty()) {
Application.currentView.selection.deleteSelection();
Application.redrawAllViews();
}
......@@ -127,7 +127,7 @@
}
arrowMovement(x, y, shiftDown, ctrlDown) {
if (!Application.currentView.selection.noSelection()) {
if (!Application.currentView.selection.isEmpty()) {
let stepSize = 10;
if (shiftDown)
stepSize = 1;
......
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