From 3ef2c1f325eea1d6f8a6c4e56240831a5f1083cc Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 19 Apr 2020 16:04:08 -0400 Subject: [PATCH] Make the view zoom to keep up when using the grow/shrink buttons --- macrovision.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/macrovision.js b/macrovision.js index 8c9fdf26..fa99a6f8 100644 --- a/macrovision.js +++ b/macrovision.js @@ -1322,6 +1322,16 @@ function doSize() { updateViewOptions(entity, entity.view); updateSizes(true); sizeDirection *= 1.05; + + const ownHeight = entity.views[entity.view].height.toNumber("meters"); + const worldHeight = config.height.toNumber("meters"); + + console.log(ownHeight, worldHeight) + if (ownHeight > worldHeight) { + setWorldHeight(config.height, entity.views[entity.view].height) + } else if (ownHeight * 10 < worldHeight) { + setWorldHeight(config.height, math.multiply(entity.views[entity.view].height, 10)); + } } }