Commit 4cccc61b authored by Christian Winter's avatar Christian Winter

clearSelection() renamed to clear()

parent 55a5a246
......@@ -298,7 +298,7 @@
}
clearAllSelections() {
this.sceneView.selection.clearSelection();
this.prefabEditorView.selection.clearSelection();
this.sceneView.selection.clear();
this.prefabEditorView.selection.clear();
}
}
\ No newline at end of file
......@@ -43,7 +43,7 @@
let prefab = this.prefabs[id];
if (Application.prefabEditorView.prefab) {
Application._currentView = Application.prefabEditorView;
Application.prefabEditorView.selection.clearSelection();
Application.prefabEditorView.selection.clear();
}
if (Application.prefabEditorView.prefab == prefab) {
......@@ -79,7 +79,7 @@
static convertPrefabWithIDToLines(id) {
if (Application.prefabEditorView.prefab &&
Application.prefabEditorView.prefab.includesNested(this.prefabs[id])) {
Application.prefabEditorView.selection.clearSelection();
Application.prefabEditorView.selection.clear();
if (Application.prefabEditorView.prefab == this.prefabs[id])
Application.prefabEditorView.setPrefab(null);
......@@ -88,7 +88,7 @@
// convert instances to lines
// TODO what happens to nested prefabs?
Application.sceneView.selection.clearSelection();
Application.sceneView.selection.clear();
// all but current layer.
// convert instances to lines and put into corresponding layer
......@@ -145,13 +145,13 @@
static deletePrefabWithID(id) {
if (Application.prefabEditorView.prefab &&
Application.prefabEditorView.prefab.includesNested(this.prefabs[id])) {
Application.prefabEditorView.selection.clearSelection();
Application.prefabEditorView.selection.clear();
if (Application.prefabEditorView.prefab == this.prefabs[id])
Application.prefabEditorView.setPrefab(null);
}
Application.sceneView.selection.clearSelection();
Application.sceneView.selection.clear();
for (let layer of Application.file.layers) {
for (let i = layer.data.instances.length - 1; i >= 0; --i) {
......@@ -189,7 +189,7 @@
Application.sceneView.selection.data.instances = [];
Application.sceneView.selection.clearSelection();
Application.sceneView.selection.clear();
Application.sceneView.selection.data.lines = lines;
Application.redrawAllViews();
......
......@@ -208,7 +208,7 @@ Utilities = new class {
Application.currentView.selection.data = sel;
Utilities.movePointsBy(Application.currentView.selection.getAllSelectedPoints(), new Vector2(x * positionSteps.x, y * positionSteps.y));
LineManipulator.rotateSelectionBy(i * angleStep);
Application.currentView.selection.clearSelection();
Application.currentView.selection.clear();
}
}
}
......@@ -219,7 +219,7 @@ Utilities = new class {
let sel = originalData.copy();
Application.currentView.selection.data = sel;
Utilities.movePointsBy(Application.currentView.selection.getAllSelectedPoints(), new Vector2(x * positionSteps.x, y * positionSteps.y));
Application.currentView.selection.clearSelection();
Application.currentView.selection.clear();
}
}
}
......@@ -228,11 +228,11 @@ Utilities = new class {
let sel = originalData.copy();
Application.currentView.selection.data = sel;
LineManipulator.rotateSelectionBy(i * angleStep);
Application.currentView.selection.clearSelection();
Application.currentView.selection.clear();
}
}
Application.currentView.selection.clearSelection();
Application.currentView.selection.clear();
}
// TODO when extruding line multiple times the line and points create the same outer lines...
......@@ -260,7 +260,7 @@ Utilities = new class {
selData.addPoint(line.end);
}
selection.clearSelection();
selection.clear();
selection.data = selData;
Application.currentView.logic.setState(new MoveLinesState());
......@@ -285,7 +285,7 @@ Utilities = new class {
if (i != j && !points[i].line.equals(points[j].line))
newSelData.addLine(new Line(points[i].position.copy(), points[j].position.copy(), points[i].line.color, points[i].line.thickness));
Application.currentView.selection.clearSelection();
Application.currentView.selection.clear();
Application.currentView.selection.data = newSelData;
Application.file.updateStats();
Application.redrawAllViews();
......
......@@ -171,7 +171,7 @@
if (this.mouseMovedAfterMouseDown == false) {
if (!Input.isKeyDown(Key.Shift)) {
this.selection.clearSelection();
this.selection.clear();
this._executeSelctionAtMousePosition();
}
......@@ -260,7 +260,7 @@
let clickedOnAlreadySelected = this.selection.selectionHit();
if (!Input.isKeyDown(Key.Shift) && !clickedOnAlreadySelected)
this.selection.clearSelection();
this.selection.clear();
if (Input.isKeyDown(Key.Shift) || !clickedOnAlreadySelected) {
this._executeSelctionAtMousePosition();
......
......@@ -22,11 +22,11 @@
addLine(line) {
if (Application.tmpCutLines()) {
Application.currentView.selection.clearSelection(true);
Application.currentView.selection.clear(true);
Utilities.cutLines(line, this._lines, false);
}
else if (Preferences.cutLines) {
Application.currentView.selection.clearSelection(true);
Application.currentView.selection.clear(true);
Utilities.cutLines(line, this._lines, true);
}
else {
......
......@@ -61,7 +61,7 @@
return;
if (this.currentLayer)
Application.sceneView.selection.clearSelection();
Application.sceneView.selection.clear();
let layer = this.layers[id];
......@@ -77,7 +77,7 @@
return;
if (this.currentLayer)
Application.sceneView.selection.clearSelection();
Application.sceneView.selection.clear();
this.currentLayer = this.layers[id];
this.layers[id].visible = true;
......@@ -89,7 +89,7 @@
toggleVisibilityOfLayerWithID(id) {
if (this.currentLayer)
Application.sceneView.selection.clearSelection();
Application.sceneView.selection.clear();
this.layers[id].visible = !this.layers[id].visible;
......
......@@ -5,7 +5,7 @@
}
// TODO rename clear()
clearSelection(dontTriggerChangedEvent) {
clear(dontTriggerChangedEvent) {
this.view.data.lines = this.view.data.lines.concat(this.data.lines).concat(this.data.partialLines);
for (let instance of this.data.instances)
......@@ -24,7 +24,7 @@
}
selectEverything() {
this.clearSelection(true);
this.clear(true);
this.data.lines = this.view.data.lines;
this.data.instances = this.view.data.instances;
......@@ -135,7 +135,7 @@
duplicate() {
let newSelData = this.data.copy();
this.clearSelection(true);
this.clear(true);
this.data = newSelData;
this.view.data.changed();
......@@ -154,7 +154,7 @@
if (this.noSelection())
this.selectEverything();
else
this.clearSelection();
this.clear();
}
selectionHit() {
......
......@@ -81,7 +81,7 @@
Application.currentView.selection.clearSelection();
Application.currentView.selection.clear();
Application.currentView.selection.data = Application.clipBoard.copy();
// if copy pasted into different views
......
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