From 4ebf43fda4b6ccac08430e0d46b3886c3c67ef0a Mon Sep 17 00:00:00 2001 From: Jordan Watkins Date: Sun, 22 Oct 2017 15:10:35 -0700 Subject: [PATCH] Display drawing zoom --- src/css/layout.css | 6 ++++++ src/js/controller/CursorCoordinatesController.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/css/layout.css b/src/css/layout.css index b9dc9e24..15fc5aa0 100644 --- a/src/css/layout.css +++ b/src/css/layout.css @@ -86,6 +86,12 @@ font-family:monospace; } +.cursor-coordinates .drawing-zoom { + position: absolute; + top: -20px; + left: 1px; +} + /** * Canvases layout */ diff --git a/src/js/controller/CursorCoordinatesController.js b/src/js/controller/CursorCoordinatesController.js index 6e494ec2..789c8525 100644 --- a/src/js/controller/CursorCoordinatesController.js +++ b/src/js/controller/CursorCoordinatesController.js @@ -17,6 +17,7 @@ $.subscribe(Events.DRAG_START, this.onDragStart_.bind(this)); $.subscribe(Events.DRAG_END, this.onDragEnd_.bind(this)); $.subscribe(Events.FRAME_SIZE_CHANGED, this.redraw.bind(this)); + $.subscribe(Events.ZOOM_CHANGED, this.redraw.bind(this)); this.redraw(); }; @@ -39,6 +40,11 @@ } } + if (pskl.app.drawingController) { + var zoom = pskl.app.drawingController.compositeRenderer.getZoom().toFixed(2); + html += '
x' + zoom + '
'; + } + this.coordinatesContainer.innerHTML = this.getFrameSizeHTML_() + html; };