Skip to content

Commit 81275a6

Browse files
committed
Fixed transform issue with Text padding.
1 parent 66d216a commit 81275a6

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • v3/src/gameobjects/text/static

v3/src/gameobjects/text/static/Text.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,6 @@ var Text = new Class({
306306
var w = textSize.width + padding.left + padding.right;
307307
var h = textSize.height + padding.top + padding.bottom;
308308

309-
// console.log(textSize);
310-
// console.log(padding);
311-
// console.log(w, 'x', h);
312-
// console.log('');
313-
314309
if (!style.fixedWidth)
315310
{
316311
this.width = w;
@@ -336,6 +331,8 @@ var Text = new Class({
336331
context.clearRect(0, 0, w, h);
337332
}
338333

334+
context.save();
335+
339336
if (style.backgroundColor)
340337
{
341338
context.fillStyle = style.backgroundColor;
@@ -397,6 +394,8 @@ var Text = new Class({
397394
}
398395
}
399396

397+
context.restore();
398+
400399
this.dirty = true;
401400

402401
return this;

0 commit comments

Comments
 (0)