From b2a32a8e8f25b7ca110b5f06dbfee9436c3765ef Mon Sep 17 00:00:00 2001 From: Rex Date: Wed, 1 May 2019 10:06:04 +0800 Subject: [PATCH] Constraints canvas size if using fixedWidth, fixedHeight style --- src/gameobjects/text/static/Text.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gameobjects/text/static/Text.js b/src/gameobjects/text/static/Text.js index cd16a8818..f4ceab17c 100644 --- a/src/gameobjects/text/static/Text.js +++ b/src/gameobjects/text/static/Text.js @@ -1129,6 +1129,11 @@ var Text = new Class({ else { this.width = style.fixedWidth; + + if (w > style.fixedWidth) + { + w = style.fixedWidth; + } } if (style.fixedHeight === 0) @@ -1138,6 +1143,11 @@ var Text = new Class({ else { this.height = style.fixedHeight; + + if (h > style.fixedHeight) + { + h = style.fixedHeight; + } } this.updateDisplayOrigin();