From c9e85e36dd510df7c65ad07c79f3c9fc6ccc7684 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 10 Mar 2019 00:27:43 +0100 Subject: [PATCH] Make zoom methods public --- src/canvas/index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/canvas/index.js b/src/canvas/index.js index 42b6753df..e479fcdc7 100644 --- a/src/canvas/index.js +++ b/src/canvas/index.js @@ -24,6 +24,8 @@ * * [setCustomBadgeLabel](#setcustombadgelabel) * * [hasFocus](#hasfocus) * * [scrollTo](#scrollto) + * * [setZoom](#setzoom) + * * [getZoom](#getzoom) * * @module Canvas */ @@ -516,10 +518,20 @@ module.exports = () => { if (hasDnd(c.em)) this.droppable = new Droppable(c.em); }, + /** + * Set zoom value + * @param {Number} value The zoom value, from 0 to 100 + * @returns {this} + */ setZoom(value) { - return canvas.set('zoom', parseFloat(value)); + canvas.set('zoom', parseFloat(value)); + return this; }, + /** + * Get zoom value + * @returns {Number} + */ getZoom() { return parseFloat(canvas.get('zoom')); },