Commit 2186ec77 authored by rockyl's avatar rockyl

修复

parent f5734fe7
...@@ -4,6 +4,7 @@ import {getRGBA, hex2string} from "../utils/index"; ...@@ -4,6 +4,7 @@ import {getRGBA, hex2string} from "../utils/index";
import {ObservablePoint, Rectangle} from "../math/index"; import {ObservablePoint, Rectangle} from "../math/index";
import Sprite from "../display/Sprite"; import Sprite from "../display/Sprite";
import {Event} from "../events/index"; import {Event} from "../events/index";
import {DisplayObject} from "../display/DisplayObject";
//文本canvas上xy的偏移量 //文本canvas上xy的偏移量
const padding = 50; const padding = 50;
...@@ -925,12 +926,13 @@ export class TextField extends Sprite { ...@@ -925,12 +926,13 @@ export class TextField extends Sprite {
* @private * @private
*/ */
_calculateBounds() { _calculateBounds() {
const {width, height} = this._localBoundsSelf; const rect = this._localBoundsSelf;
var matrix = this.transform.worldMatrix; var matrix = this.transform.worldMatrix;
this._bounds.x = matrix.tx; matrix.transformPoint(rect.x, rect.y, DisplayObject._p1);
this._bounds.y = matrix.ty; matrix.transformPoint(rect.x + rect.width, rect.y, DisplayObject._p2);
this._bounds.width = width; matrix.transformPoint(rect.x + rect.width, rect.y + rect.height, DisplayObject._p3);
this._bounds.height = height; 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