From bc6ec0a124e70c1c80b319afb645b204bee0d30a Mon Sep 17 00:00:00 2001 From: Emil Schnedler Vad Date: Sat, 8 Apr 2023 20:37:12 +0200 Subject: [PATCH] reverted using getTextBounds for cotainer getBounds() --- src/gameobjects/container/Container.js | 29 +++++++++----------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/gameobjects/container/Container.js b/src/gameobjects/container/Container.js index 18f337eb9..78e58f30e 100644 --- a/src/gameobjects/container/Container.js +++ b/src/gameobjects/container/Container.js @@ -407,28 +407,19 @@ var Container = new Class({ { var entry = children[i]; - if (entry.getTextBounds) - { - var textBounds = entry.getTextBounds().global; - tempRect.setTo(textBounds.x, textBounds.y, textBounds.width, textBounds.height); - } - else if (entry.getBounds) + if (entry.getBounds) { entry.getBounds(tempRect); - } - else - { - continue; - } - if (!hasSetFirst) - { - output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height); - hasSetFirst = true; - } - else - { - Union(tempRect, output, output); + if (!hasSetFirst) + { + output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height); + hasSetFirst = true; + } + else + { + Union(tempRect, output, output); + } } } }