@galacean/engine-ui 1.5.7 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -527,6 +527,13 @@
527
527
  return _this;
528
528
  }
529
529
  var _proto = UITransform.prototype;
530
+ // @ts-ignore
531
+ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
532
+ // @ts-ignore
533
+ Transform.prototype._cloneTo.call(this, target, srcRoot, targetRoot);
534
+ target.size.copyFrom(this._size);
535
+ target.pivot.copyFrom(this._pivot);
536
+ };
530
537
  _proto._onSizeChange = function _onSizeChange() {
531
538
  // @ts-ignore
532
539
  this._entity._updateFlagManager.dispatch(512);
@@ -836,7 +843,7 @@
836
843
  _inherits(UIInteractive, Script);
837
844
  function UIInteractive(entity) {
838
845
  var _this;
839
- _this = Script.call(this, entity) || this, /** @internal */ _this._indexInRootCanvas = -1, /** @internal */ _this._isRootCanvasDirty = false, /** @internal */ _this._rootCanvasListeningEntities = [], /** @internal */ _this._indexInGroup = -1, /** @internal */ _this._isGroupDirty = false, /** @internal */ _this._groupListeningEntities = [], /** @internal */ _this._globalInteractive = false, /** @internal */ _this._globalInteractiveDirty = false, _this._interactive = true, _this._state = 0, _this._transitions = [], /** @todo Multi-touch points are not considered yet. */ _this._isPointerInside = false, _this._isPointerDragging = false;
846
+ _this = Script.call(this, entity) || this, /** @internal */ _this._indexInRootCanvas = -1, /** @internal */ _this._isRootCanvasDirty = false, /** @internal */ _this._rootCanvasListeningEntities = [], /** @internal */ _this._indexInGroup = -1, /** @internal */ _this._isGroupDirty = false, /** @internal */ _this._groupListeningEntities = [], /** @internal */ _this._globalInteractive = false, /** @internal */ _this._globalInteractiveDirty = false, _this._transitions = [], _this._interactive = true, _this._state = 0, /** @todo Multi-touch points are not considered yet. */ _this._isPointerInside = false, _this._isPointerDragging = false;
840
847
  _this._groupListener = _this._groupListener.bind(_this);
841
848
  _this._rootCanvasListener = _this._rootCanvasListener.bind(_this);
842
849
  return _this;
@@ -909,6 +916,26 @@
909
916
  transitions[i].destroy();
910
917
  }
911
918
  };
919
+ // @ts-ignore
920
+ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
921
+ var transitions = this._transitions;
922
+ for(var i = 0, n = transitions.length; i < n; i++){
923
+ var srcTransition = transitions[i];
924
+ var dstTransition = new transitions[i].constructor();
925
+ dstTransition.normal = srcTransition.normal;
926
+ dstTransition.pressed = srcTransition.pressed;
927
+ dstTransition.hover = srcTransition.hover;
928
+ dstTransition.disabled = srcTransition.disabled;
929
+ var transitionTarget = srcTransition.target;
930
+ if (transitionTarget) {
931
+ var paths = UIInteractive._targetTempPath;
932
+ // @ts-ignore
933
+ var success = engine.Entity._getEntityHierarchyPath(srcRoot, transitionTarget.entity, paths);
934
+ dstTransition.target = success ? engine.Entity._getEntityByHierarchyPath(targetRoot, paths).getComponent(transitionTarget.constructor) : transitionTarget;
935
+ }
936
+ target.addTransition(dstTransition);
937
+ }
938
+ };
912
939
  /**
913
940
  * @internal
914
941
  */ _proto._getRootCanvas = function _getRootCanvas() {
@@ -1019,6 +1046,7 @@
1019
1046
  ]);
1020
1047
  return UIInteractive;
1021
1048
  }(engine.Script);
1049
+ UIInteractive._targetTempPath = new Array();
1022
1050
  __decorate([
1023
1051
  engine.ignoreClone
1024
1052
  ], UIInteractive.prototype, "_rootCanvas", void 0);
@@ -1049,6 +1077,9 @@
1049
1077
  __decorate([
1050
1078
  engine.ignoreClone
1051
1079
  ], UIInteractive.prototype, "_globalInteractiveDirty", void 0);
1080
+ __decorate([
1081
+ engine.ignoreClone
1082
+ ], UIInteractive.prototype, "_transitions", void 0);
1052
1083
  __decorate([
1053
1084
  engine.ignoreClone
1054
1085
  ], UIInteractive.prototype, "_groupListener", null);
@@ -2898,9 +2929,9 @@
2898
2929
  Transition: Transition
2899
2930
  });
2900
2931
 
2901
- var uiDefaultFs = "#define GLSLIFY 1\n#include <common>\nuniform sampler2D renderer_UITexture;\n\nvarying vec2 v_uv;\nvarying vec4 v_color;\n\nvoid main() {\n vec4 baseColor = texture2DSRGB(renderer_UITexture, v_uv);\n vec4 finalColor = baseColor * v_color;\n #ifdef ENGINE_SHOULD_SRGB_CORRECT\n finalColor = outputSRGBCorrection(finalColor);\n #endif\n gl_FragColor = finalColor;\n}"; // eslint-disable-line
2932
+ var uiDefaultFs = "#include <common>\nuniform sampler2D renderer_UITexture;\n\nvarying vec2 v_uv;\nvarying vec4 v_color;\n\nvoid main() {\n vec4 baseColor = texture2DSRGB(renderer_UITexture, v_uv);\n vec4 finalColor = baseColor * v_color;\n #ifdef ENGINE_SHOULD_SRGB_CORRECT\n finalColor = outputSRGBCorrection(finalColor);\n #endif\n gl_FragColor = finalColor;\n}"; // eslint-disable-line
2902
2933
 
2903
- var uiDefaultVs = "#define GLSLIFY 1\nuniform mat4 renderer_MVPMat;\n\nattribute vec3 POSITION;\nattribute vec2 TEXCOORD_0;\nattribute vec4 COLOR_0;\n\nvarying vec2 v_uv;\nvarying vec4 v_color;\n\nvoid main() {\n gl_Position = renderer_MVPMat * vec4(POSITION, 1.0);\n\n v_uv = TEXCOORD_0;\n v_color = COLOR_0;\n}\n"; // eslint-disable-line
2934
+ var uiDefaultVs = "uniform mat4 renderer_MVPMat;\n\nattribute vec3 POSITION;\nattribute vec2 TEXCOORD_0;\nattribute vec4 COLOR_0;\n\nvarying vec2 v_uv;\nvarying vec4 v_color;\n\nvoid main() {\n gl_Position = renderer_MVPMat * vec4(POSITION, 1.0);\n\n v_uv = TEXCOORD_0;\n v_color = COLOR_0;\n}\n"; // eslint-disable-line
2904
2935
 
2905
2936
  /**
2906
2937
  * @internal