Skip to content

Commit b2a32a8

Browse files
committed
Constraints canvas size if using fixedWidth, fixedHeight style
1 parent a05cd93 commit b2a32a8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/gameobjects/text/static/Text.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,11 @@ var Text = new Class({
11291129
else
11301130
{
11311131
this.width = style.fixedWidth;
1132+
1133+
if (w > style.fixedWidth)
1134+
{
1135+
w = style.fixedWidth;
1136+
}
11321137
}
11331138

11341139
if (style.fixedHeight === 0)
@@ -1138,6 +1143,11 @@ var Text = new Class({
11381143
else
11391144
{
11401145
this.height = style.fixedHeight;
1146+
1147+
if (h > style.fixedHeight)
1148+
{
1149+
h = style.fixedHeight;
1150+
}
11411151
}
11421152

11431153
this.updateDisplayOrigin();

0 commit comments

Comments
 (0)