From 87f7399b0bed19bfeb98811a1a1e0dfb47c9eebd Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 17 Oct 2019 22:20:22 +0200 Subject: [PATCH] forced recalculation impleneted --- Candles.js | 9 +++++++-- Volumes.js | 13 +++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Candles.js b/Candles.js index 7387b2d1f..d171693ad 100644 --- a/Candles.js +++ b/Candles.js @@ -796,12 +796,17 @@ } } - function onOffsetChanged() { + function onOffsetChanged(event) { try { + if (event !== undefined) { + if (event.recalculate === true) { + recalculate() + return + } + } if (Math.random() * 100 > 95) { - recalculate() }; diff --git a/Volumes.js b/Volumes.js index f94b8322a..be89d403e 100644 --- a/Volumes.js +++ b/Volumes.js @@ -807,16 +807,21 @@ } } - function onOffsetChanged() { + function onOffsetChanged(event) { try { - + if (event !== undefined) { + if (event.recalculate === true) { + recalculateScaleX(); + recalculate(); + recalculateScaleY(); + return + } + } if (Math.random() * 100 > 95) { - recalculateScaleX(); recalculate(); recalculateScaleY(); - }; } catch (err) {