Commit 2186ec77 authored by rockyl's avatar rockyl

修复

parent f5734fe7
......@@ -4,6 +4,7 @@ import {getRGBA, hex2string} from "../utils/index";
import {ObservablePoint, Rectangle} from "../math/index";
import Sprite from "../display/Sprite";
import {Event} from "../events/index";
import {DisplayObject} from "../display/DisplayObject";
//文本canvas上xy的偏移量
const padding = 50;
......@@ -925,12 +926,13 @@ export class TextField extends Sprite {
* @private
*/
_calculateBounds() {
const {width, height} = this._localBoundsSelf;
const rect = this._localBoundsSelf;
var matrix = this.transform.worldMatrix;
this._bounds.x = matrix.tx;
this._bounds.y = matrix.ty;
this._bounds.width = width;
this._bounds.height = height;
matrix.transformPoint(rect.x, rect.y, DisplayObject._p1);
matrix.transformPoint(rect.x + rect.width, rect.y, DisplayObject._p2);
matrix.transformPoint(rect.x + rect.width, rect.y + rect.height, DisplayObject._p3);
matrix.transformPoint(rect.x, rect.y + rect.height, DisplayObject._p4);
Rectangle.createFromPoints(this._bounds, DisplayObject._p1, DisplayObject._p2, DisplayObject._p3, DisplayObject._p4);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment