Commit f277d24c authored by 任建锋's avatar 任建锋

--

parents eb82bee2 241d4727
...@@ -19734,6 +19734,20 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -19734,6 +19734,20 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Image.prototype.onDataMutated = function (e) { Image.prototype.onDataMutated = function (e) {
this._setSourceDirect(dataCenter.formatString(this._originText, this._escapes)); this._setSourceDirect(dataCenter.formatString(this._originText, this._escapes));
}; };
Object.defineProperty(Image.prototype, "textureWidth", {
get: function () {
return this._texture ? this._texture.width : 0;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Image.prototype, "textureHeight", {
get: function () {
return this._texture ? this._texture.height : 0;
},
enumerable: true,
configurable: true
});
return Image; return Image;
}(Sprite)); }(Sprite));
...@@ -21751,7 +21765,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21751,7 +21765,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
globalPos.x *= devicePixelRatio; globalPos.x *= devicePixelRatio;
globalPos.y *= devicePixelRatio; globalPos.y *= devicePixelRatio;
var node = this.hitTestPoint(globalPos, true); var node = this.hitTestPoint(globalPos, true);
console.log(globalPos.x, globalPos.y, node ? node.name : '');
return node; return node;
}; };
return EditorStage; return EditorStage;
......
This diff is collapsed.
...@@ -11,7 +11,7 @@ import {Point} from "../../2d/math/Point"; ...@@ -11,7 +11,7 @@ import {Point} from "../../2d/math/Point";
import {alignMgr} from "../decorators/AlignManager"; import {alignMgr} from "../decorators/AlignManager";
const propPrefixFilter = ['_', '__', '$']; const propPrefixFilter = ['_', '__', '$'];
const includeProps = ['_width', '_height', 'worldMatrix', 'texture']; const includeProps = ['_width', '_height', 'worldMatrix'];
const excludeProps = ['eventTypes', 'eventTypes1', 'tempDisplayObjectParent', 'renderable', 'destroyed', 'children', 'start', 'pluginName', 'isUI', 'crossOrigin']; const excludeProps = ['eventTypes', 'eventTypes1', 'tempDisplayObjectParent', 'renderable', 'destroyed', 'children', 'start', 'pluginName', 'isUI', 'crossOrigin'];
const propTypeFilter = ['function', 'object']; const propTypeFilter = ['function', 'object'];
const offsetPrefix = 'offset_'; const offsetPrefix = 'offset_';
...@@ -147,7 +147,7 @@ export class EditorStage extends Node { ...@@ -147,7 +147,7 @@ export class EditorStage extends Node {
let node = this.hitTestPoint(globalPos, true); let node = this.hitTestPoint(globalPos, true);
console.log(globalPos.x, globalPos.y, node ? node.name : ''); //console.log(globalPos.x, globalPos.y, node ? node.name : '');
return node; return node;
} }
......
...@@ -120,4 +120,12 @@ export class Image extends Sprite implements IUIComponent { ...@@ -120,4 +120,12 @@ export class Image extends Sprite implements IUIComponent {
private onDataMutated(e = null) { private onDataMutated(e = null) {
this._setSourceDirect(dataCenter.formatString(this._originText, this._escapes)); this._setSourceDirect(dataCenter.formatString(this._originText, this._escapes));
} }
get textureWidth(){
return this._texture ? this._texture.width : 0;
}
get textureHeight(){
return this._texture ? this._texture.height : 0;
}
} }
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