Skip to content

Commit a05cd93

Browse files
committed
Update rectangle hitarea when updated text
1 parent 7c4fd3f commit a05cd93

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/gameobjects/text/static/Text.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var GetValue = require('../../../utils/object/GetValue');
1515
var RemoveFromDOM = require('../../../dom/RemoveFromDOM');
1616
var TextRender = require('./TextRender');
1717
var TextStyle = require('../TextStyle');
18+
var Rectangle = require('../../../geom/rectangle/Rectangle');
1819

1920
/**
2021
* @classdesc
@@ -1237,6 +1238,12 @@ var Text = new Class({
12371238

12381239
this.dirty = true;
12391240

1241+
if (this.input && this.input.hitArea instanceof Rectangle)
1242+
{
1243+
this.input.hitArea.width = this.width;
1244+
this.input.hitArea.height = this.height;
1245+
}
1246+
12401247
return this;
12411248
},
12421249

0 commit comments

Comments
 (0)