Skip to content

Commit 9672602

Browse files
authored
Merge pull request phaserjs#4504 from rexrainbow/master
Constraints canvas size via object size
2 parents 73d5007 + 72df134 commit 9672602

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
@@ -1139,6 +1139,16 @@ var Text = new Class({
11391139
this.height = style.fixedHeight;
11401140
}
11411141

1142+
if (w > this.width)
1143+
{
1144+
w = this.width;
1145+
}
1146+
1147+
if (h > this.height)
1148+
{
1149+
h = this.height;
1150+
}
1151+
11421152
this.updateDisplayOrigin();
11431153

11441154
w *= resolution;

0 commit comments

Comments
 (0)