Fixed new pixel creation bug and preview canvas blurriness

It's now possible to create a new project of a different size from the one decided when opening the app. Also fixed a bug that made the layer preview canvases blurry. They're now pixel perfect.
This commit is contained in:
unsettledgames
2020-06-20 22:49:02 +02:00
parent ab4129546c
commit d9d1406d57
5 changed files with 66 additions and 19 deletions

View File

@@ -118,9 +118,6 @@ class Layer {
if (menuEntry != null) {
menuEntry.id = "layer" + id;
}
if (menuEntry != null) {
menuEntry.onclick = () => this.select();
menuEntry.getElementsByTagName("button")[0].onclick = () => this.toggleLock();
menuEntry.getElementsByTagName("button")[1].onclick = () => this.toggleVisibility();
@@ -130,6 +127,8 @@ class Layer {
menuEntry.addEventListener("dragover", this.layerDragOver, false);
menuEntry.addEventListener("dragleave", this.layerDragLeave, false);
menuEntry.addEventListener("dragend", this.layerDragEnd, false);
menuEntry.getElementsByTagName("canvas")[0].getContext('2d').imageSmoothingEnabled = false;
}
this.initialize();