Fixed transform issue with Text padding.

This commit is contained in:
Richard Davey 2017-12-01 16:52:53 +00:00
parent 66d216af19
commit 81275a6197

View file

@ -306,11 +306,6 @@ var Text = new Class({
var w = textSize.width + padding.left + padding.right; var w = textSize.width + padding.left + padding.right;
var h = textSize.height + padding.top + padding.bottom; var h = textSize.height + padding.top + padding.bottom;
// console.log(textSize);
// console.log(padding);
// console.log(w, 'x', h);
// console.log('');
if (!style.fixedWidth) if (!style.fixedWidth)
{ {
this.width = w; this.width = w;
@ -336,6 +331,8 @@ var Text = new Class({
context.clearRect(0, 0, w, h); context.clearRect(0, 0, w, h);
} }
context.save();
if (style.backgroundColor) if (style.backgroundColor)
{ {
context.fillStyle = style.backgroundColor; context.fillStyle = style.backgroundColor;
@ -397,6 +394,8 @@ var Text = new Class({
} }
} }
context.restore();
this.dirty = true; this.dirty = true;
return this; return this;