Color pattern and brush type are now retained when switching between tiles

This commit is contained in:
Brendan Robert 2020-02-24 09:05:05 -06:00
parent 6637e623fa
commit 3e025e405f

View File

@ -1,10 +1,10 @@
/*
* Copyright (C) 2015 The 8-Bit Bunch. Licensed under the Apache License, Version 1.1
* Copyright (C) 2015 The 8-Bit Bunch. Licensed under the Apache License, Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-1.1>.
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
* ANY KIND, either express or implied. See the License for the specific language
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
* ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.badvision.outlaweditor.apple;
@ -22,8 +22,8 @@ import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.Shape;
import org.badvision.outlaweditor.api.Platform;
import org.badvision.outlaweditor.TileEditor;
import org.badvision.outlaweditor.api.Platform;
import org.badvision.outlaweditor.data.DataUtilities;
import org.badvision.outlaweditor.data.TileUtils;
import org.badvision.outlaweditor.data.xml.Tile;
@ -80,6 +80,9 @@ public class AppleTileEditor extends TileEditor {
if (lastSelectedPattern != null) {
changeCurrentPattern(lastSelectedPattern);
}
if (lastDrawMode != null) {
setDrawMode(lastDrawMode);
}
}
@Override
@ -156,9 +159,11 @@ public class AppleTileEditor extends TileEditor {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
static DrawMode lastDrawMode = null;
@Override
public void setDrawMode(DrawMode drawMode) {
this.drawMode = drawMode;
lastDrawMode = drawMode;
lastActionX = -1;
lastActionY = -1;
}