diff --git a/index.html b/index.html index b6bb7ff..9550a6b 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,19 @@ +
+ Loading pixels ... +
diff --git a/js/controller/PreviewFilmController.js b/js/controller/PreviewFilmController.js index 67f0f03..8fdce87 100644 --- a/js/controller/PreviewFilmController.js +++ b/js/controller/PreviewFilmController.js @@ -180,7 +180,7 @@ } var tileCount = document.createElement("div"); tileCount.className = "tile-overlay tile-count"; - tileCount.innerHTML = tileNumber; + tileCount.innerHTML = tileNumber + 1; previewTileRoot.appendChild(tileCount); diff --git a/js/drawingtools/BaseTool.js b/js/drawingtools/BaseTool.js index 890c045..1d2dfd4 100644 --- a/js/drawingtools/BaseTool.js +++ b/js/drawingtools/BaseTool.js @@ -32,9 +32,11 @@ }; ns.BaseTool.prototype.hideHighlightedPixel = function(overlay) { - overlay.setPixel(this.highlightedPixelCol, this.highlightedPixelRow, Constants.TRANSPARENT_COLOR); - this.highlightedPixelRow = null; - this.highlightedPixelCol = null; + if (this.highlightedPixelRow !== null && this.highlightedPixelCol !== null) { + overlay.setPixel(this.highlightedPixelCol, this.highlightedPixelRow, Constants.TRANSPARENT_COLOR); + this.highlightedPixelRow = null; + this.highlightedPixelCol = null; + } }; diff --git a/js/drawingtools/selectiontools/BaseSelect.js b/js/drawingtools/selectiontools/BaseSelect.js index 3ed2987..b5ca0da 100644 --- a/js/drawingtools/selectiontools/BaseSelect.js +++ b/js/drawingtools/selectiontools/BaseSelect.js @@ -70,6 +70,9 @@ } }; + ns.BaseSelect.prototype.hideHighlightedPixel = function () { + // not implemented for selection tools + }; /** * If we mouseover the selection draw inside the overlay frame, show the 'move' cursor diff --git a/piskel-boot.js b/piskel-boot.js index 9317ca2..b9be8a9 100644 --- a/piskel-boot.js +++ b/piskel-boot.js @@ -1,4 +1,16 @@ (function () { + + window.onPiskelReady = function () { + var loadingMask = document.getElementById('loading-mask'); + loadingMask.style.opacity = 0; + window.setTimeout(function () {loadingMask.parentNode.removeChild(loadingMask);}, 600) + pskl.app.init(); + // cleanup + delete window.exports; + delete window.loadDebugScripts; + delete window.done; + }; + var prefixPath = function (path) { if (window.pskl && window.pskl.appEngineToken_) { return '../' + path; @@ -29,11 +41,7 @@ var scriptIndex = 0; window.loadNextScript = function () { if (scriptIndex == window.exports.scripts.length) { - pskl.app.init(); - // cleanup - delete window.exports; - delete window.loadDebugScripts; - delete window.done; + window.onPiskelReady(); } else { loadScript(window.exports.scripts[scriptIndex], "loadNextScript()"); scriptIndex ++; @@ -60,7 +68,7 @@ var loaderInterval = window.setInterval(function () { if (document.querySelectorAll("[data-iframe-loader]").length === 0) { window.clearInterval(loaderInterval); - loadScript(script, "pskl.app.init()"); + loadScript(script, "onPiskelReady()"); } else { console.log("waiting for templates to load ...."); }