From 57ca7f769b20d0bff690be597e411ae05deb4e46 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 22 May 2020 01:57:46 +0300 Subject: [PATCH] minor fix... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/components/ig-image-graph.js | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ui (gen4)/lib/components/ig-image-graph.js b/ui (gen4)/lib/components/ig-image-graph.js index 8c88cc8e..1fdd21c1 100644 --- a/ui (gen4)/lib/components/ig-image-graph.js +++ b/ui (gen4)/lib/components/ig-image-graph.js @@ -491,7 +491,7 @@ object.Constructor('igImageGraph', HTMLElement, { // load button state... var _update = function(){ Object.assign(button.style, - !that.__rotated ? + that.__rotated == null ? { transform: '', marginTop: '-2px', @@ -502,16 +502,20 @@ object.Constructor('igImageGraph', HTMLElement, { }) } _update() button.disabled = that.graph != 'waveform' + // do the rotation... button.onclick = function(){ - var n = that.orientation = - that.orientation == 0 ? - 90 - : that.orientation == 180 ? - 270 - : that.orientation == 270 ? - 180 - : 0 - var r = that.__rotated = !that.__rotated + var o = that.__rotated + var c = that.orientation*1 + + that.orientation = o == null ? + // rotate... + (c + 90) % 360 + // restore... + : o + + that.__rotated = o == null ? + c + : null _update() } return button }(),