From 432d6589aaf516accee3e682ecafa1df223b8d34 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Mon, 28 Jun 2021 14:10:22 -0400 Subject: [PATCH] Account for extra height when resizing an entity This only applies for the grow/shrink buttons on the sides --- macrovision.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/macrovision.js b/macrovision.js index 51dcb388..89893efc 100644 --- a/macrovision.js +++ b/macrovision.js @@ -2704,12 +2704,14 @@ function doSize() { sizeDirection *= 1.01; const ownHeight = entity.views[entity.view].height.toNumber("meters"); + let extra = entity.views[entity.view].image.extra; + extra = extra === undefined ? 1 : extra; const worldHeight = config.height.toNumber("meters"); - 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)); + if (ownHeight * extra > worldHeight) { + setWorldHeight(config.height, math.multiply(entity.views[entity.view].height, extra)); + } else if (ownHeight * extra * 10 < worldHeight) { + setWorldHeight(config.height, math.multiply(entity.views[entity.view].height, extra * 10)); } } }