diff --git a/src/css/tools.css b/src/css/tools.css index 975ae227..3b0dbcf2 100644 --- a/src/css/tools.css +++ b/src/css/tools.css @@ -167,7 +167,7 @@ .tool-color-picker:nth-child(2) { z-index : 90; - margin-top: 20px; + margin-top: 25px; margin-left:-20px; } diff --git a/src/js/controller/DrawingController.js b/src/js/controller/DrawingController.js index 413f0c24..d3c9818d 100644 --- a/src/js/controller/DrawingController.js +++ b/src/js/controller/DrawingController.js @@ -60,6 +60,7 @@ $.subscribe(Events.USER_SETTINGS_CHANGED, $.proxy(this.onUserSettingsChange_, this)); $.subscribe(Events.FRAME_SIZE_CHANGED, $.proxy(this.onFrameSizeChanged_, this)); + // this.afterWindowResize_.bind(this); window.setTimeout(this.afterWindowResize_.bind(this), 100); }; diff --git a/src/js/rendering/frame/CachedFrameRenderer.js b/src/js/rendering/frame/CachedFrameRenderer.js index e2306dd2..79e6d5f7 100644 --- a/src/js/rendering/frame/CachedFrameRenderer.js +++ b/src/js/rendering/frame/CachedFrameRenderer.js @@ -14,6 +14,20 @@ pskl.utils.inherit(pskl.rendering.frame.CachedFrameRenderer, pskl.rendering.frame.FrameRenderer); + /** + * Only call display size if provided values are different from current values. + * FrameRenderer:setDisplaySize destroys the underlying canvas + * If the canvas is destroyed, a rendering is mandatory. + * (Alternatively we could find a way to force the rendering of the CachedFrameRenderer from the outside) + * @param {Number} width + * @param {Number} height + */ + ns.CachedFrameRenderer.prototype.setDisplaySize = function (width, height) { + if (this.displayWidth !== width || this.displayHeight !== height) { + pskl.rendering.frame.FrameRenderer.prototype.setDisplaySize.call(this, width, height); + } + }; + ns.CachedFrameRenderer.prototype.render = function (frame) { var offset = this.getOffset(); var size = this.getDisplaySize();