MCPcopy Create free account
hub / github.com/esengine/esengine / handleXYChanged

Method handleXYChanged

packages/fairygui/src/core/GObject.ts:893–910  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

891 // Handle property changes | 处理属性变化
892
893 protected handleXYChanged(): void {
894 let xv = this._x;
895 let yv = this._y + this._yOffset;
896
897 if (this._pivotAsAnchor) {
898 xv -= this._pivotX * this._width;
899 yv -= this._pivotY * this._height;
900 }
901
902 if (this._pixelSnapping) {
903 xv = Math.round(xv);
904 yv = Math.round(yv);
905 }
906
907 if (this._displayObject) {
908 this._displayObject.setPosition(xv + this._pivotOffsetX, yv + this._pivotOffsetY);
909 }
910 }
911
912 protected handleSizeChanged(): void {
913 if (this._displayObject) {

Callers 5

setXYMethod · 0.95
pixelSnappingMethod · 0.95
setPivotMethod · 0.95
internalSetPivotMethod · 0.95
applyPivotMethod · 0.95

Calls 1

setPositionMethod · 0.45

Tested by

no test coverage detected