@wcardinal/wcardinal-ui 0.330.0 → 0.332.0
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/types/wcardinal/ui/d-animation-base.d.ts +3 -1
- package/dist/types/wcardinal/ui/d-animation.d.ts +21 -3
- package/dist/types/wcardinal/ui/d-view-gesture-impl.d.ts +7 -4
- package/dist/types/wcardinal/ui/d-view-impl.d.ts +2 -2
- package/dist/types/wcardinal/ui/d-view-parent.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-view-transform-impl.d.ts +8 -4
- package/dist/types/wcardinal/ui/d-view.d.ts +35 -0
- package/dist/types/wcardinal/ui/index.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/e-shape-connector-edge-impl.d.ts +7 -1
- package/dist/types/wcardinal/ui/util/util-gesture.d.ts +12 -0
- package/dist/wcardinal/ui/d-animation-base.js +10 -0
- package/dist/wcardinal/ui/d-animation-base.js.map +1 -1
- package/dist/wcardinal/ui/d-animation.js.map +1 -1
- package/dist/wcardinal/ui/d-view-gesture-impl.js +30 -9
- package/dist/wcardinal/ui/d-view-gesture-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-view-impl.js +44 -27
- package/dist/wcardinal/ui/d-view-impl.js.map +1 -1
- package/dist/wcardinal/ui/{d-view-stopper.js → d-view-parent.js} +1 -1
- package/dist/wcardinal/ui/d-view-parent.js.map +1 -0
- package/dist/wcardinal/ui/d-view-transform-impl.js +30 -5
- package/dist/wcardinal/ui/d-view-transform-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-view.js.map +1 -1
- package/dist/wcardinal/ui/index.js +1 -1
- package/dist/wcardinal/ui/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-connector-edge-container-impl.js +6 -2
- package/dist/wcardinal/ui/shape/e-shape-connector-edge-container-impl.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js +88 -26
- package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js.map +1 -1
- package/dist/wcardinal/ui/util/util-gesture.js +22 -0
- package/dist/wcardinal/ui/util/util-gesture.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +229 -69
- package/dist/wcardinal-ui.js +229 -69
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/wcardinal/ui/d-view-stopper.d.ts +0 -4
- package/dist/wcardinal/ui/d-view-stopper.js.map +0 -1
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.332.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -15280,6 +15280,7 @@
|
|
|
15280
15280
|
};
|
|
15281
15281
|
_this._onStart = options === null || options === void 0 ? void 0 : options.onStart;
|
|
15282
15282
|
_this._onEnd = options === null || options === void 0 ? void 0 : options.onEnd;
|
|
15283
|
+
_this._onStop = options === null || options === void 0 ? void 0 : options.onStop;
|
|
15283
15284
|
_this._timing = (_c = options === null || options === void 0 ? void 0 : options.timing) !== null && _c !== void 0 ? _c : DAnimationTimings.ELASTIC;
|
|
15284
15285
|
// Events
|
|
15285
15286
|
var on = options === null || options === void 0 ? void 0 : options.on;
|
|
@@ -15348,6 +15349,13 @@
|
|
|
15348
15349
|
}
|
|
15349
15350
|
this.emit("end", isReverse, this);
|
|
15350
15351
|
};
|
|
15352
|
+
DAnimationBase.prototype.onStop = function (isReverse) {
|
|
15353
|
+
var onStop = this._onStop;
|
|
15354
|
+
if (onStop != null) {
|
|
15355
|
+
onStop(isReverse, this);
|
|
15356
|
+
}
|
|
15357
|
+
this.emit("stop", isReverse, this);
|
|
15358
|
+
};
|
|
15351
15359
|
DAnimationBase.prototype.isStarted = function () {
|
|
15352
15360
|
return this._id != null;
|
|
15353
15361
|
};
|
|
@@ -15384,6 +15392,8 @@
|
|
|
15384
15392
|
if (id != null) {
|
|
15385
15393
|
this._id = null;
|
|
15386
15394
|
window.clearTimeout(id);
|
|
15395
|
+
// OnStop
|
|
15396
|
+
this.onStop(this._reverse);
|
|
15387
15397
|
}
|
|
15388
15398
|
};
|
|
15389
15399
|
DAnimationBase.prototype.end = function () {
|
|
@@ -15596,6 +15606,12 @@
|
|
|
15596
15606
|
this._onStart = on.start;
|
|
15597
15607
|
this._onMove = on.move;
|
|
15598
15608
|
this._onEnd = on.end;
|
|
15609
|
+
this._onStop = on.stop;
|
|
15610
|
+
var easing = on.easing;
|
|
15611
|
+
if (easing != null) {
|
|
15612
|
+
this._onEasingStart = easing.start;
|
|
15613
|
+
this._onEasingEnd = easing.end;
|
|
15614
|
+
}
|
|
15599
15615
|
}
|
|
15600
15616
|
this._modifier = (_a = options === null || options === void 0 ? void 0 : options.modifier) !== null && _a !== void 0 ? _a : UtilGestureModifier.NONE;
|
|
15601
15617
|
var checker = options.checker;
|
|
@@ -15794,12 +15810,20 @@
|
|
|
15794
15810
|
onEnd(target);
|
|
15795
15811
|
}
|
|
15796
15812
|
// Start the Easing
|
|
15813
|
+
var onEasingStart = this._onEasingStart;
|
|
15814
|
+
if (onEasingStart) {
|
|
15815
|
+
onEasingStart(data.target);
|
|
15816
|
+
}
|
|
15797
15817
|
var easing = data.easing;
|
|
15798
15818
|
if (easing) {
|
|
15799
15819
|
easing.onEnd(e.data.originalEvent.timeStamp - data.time);
|
|
15800
15820
|
}
|
|
15801
15821
|
else {
|
|
15802
15822
|
this.deleteData(data);
|
|
15823
|
+
var onEasingEnd = this._onEasingEnd;
|
|
15824
|
+
if (onEasingEnd) {
|
|
15825
|
+
onEasingEnd(data.target);
|
|
15826
|
+
}
|
|
15803
15827
|
}
|
|
15804
15828
|
};
|
|
15805
15829
|
UtilGesture.prototype.onEasingMove = function (dx, dy, ds, time, data) {
|
|
@@ -15822,6 +15846,10 @@
|
|
|
15822
15846
|
};
|
|
15823
15847
|
UtilGesture.prototype.onEasingEnd = function (data) {
|
|
15824
15848
|
this.deleteData(data);
|
|
15849
|
+
var onEasingEnd = this._onEasingEnd;
|
|
15850
|
+
if (onEasingEnd) {
|
|
15851
|
+
onEasingEnd(data.target);
|
|
15852
|
+
}
|
|
15825
15853
|
};
|
|
15826
15854
|
UtilGesture.prototype.stop = function (target) {
|
|
15827
15855
|
var _a;
|
|
@@ -15831,6 +15859,10 @@
|
|
|
15831
15859
|
}
|
|
15832
15860
|
(_a = data.easing) === null || _a === void 0 ? void 0 : _a.stop();
|
|
15833
15861
|
this.deleteData(data);
|
|
15862
|
+
var onStop = this._onStop;
|
|
15863
|
+
if (onStop) {
|
|
15864
|
+
onStop(target);
|
|
15865
|
+
}
|
|
15834
15866
|
};
|
|
15835
15867
|
return UtilGesture;
|
|
15836
15868
|
}());
|
|
@@ -15840,11 +15872,11 @@
|
|
|
15840
15872
|
* SPDX-License-Identifier: Apache-2.0
|
|
15841
15873
|
*/
|
|
15842
15874
|
var DViewGestureImpl = /** @class */ (function () {
|
|
15843
|
-
function DViewGestureImpl(
|
|
15875
|
+
function DViewGestureImpl(owner, toTarget, parent, constraint, theme, options) {
|
|
15844
15876
|
var _this = this;
|
|
15845
15877
|
var _a, _b;
|
|
15878
|
+
this._owner = owner;
|
|
15846
15879
|
this._parent = parent;
|
|
15847
|
-
this._stopper = stopper;
|
|
15848
15880
|
this._constraint = constraint;
|
|
15849
15881
|
var mode = toEnum((_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : theme.getGestureMode(), UtilGestureMode);
|
|
15850
15882
|
var modifier = toEnum((_b = options === null || options === void 0 ? void 0 : options.modifier) !== null && _b !== void 0 ? _b : theme.getGestureModifier(), UtilGestureModifier);
|
|
@@ -15858,24 +15890,45 @@
|
|
|
15858
15890
|
},
|
|
15859
15891
|
on: {
|
|
15860
15892
|
start: function () {
|
|
15861
|
-
_this.
|
|
15893
|
+
_this.onStart();
|
|
15862
15894
|
},
|
|
15863
15895
|
move: function (target, dx, dy, x, y, ds) {
|
|
15864
|
-
_this.onGestureMove(toTarget(
|
|
15896
|
+
_this.onGestureMove(toTarget(owner), dx, dy, x, y, ds);
|
|
15897
|
+
},
|
|
15898
|
+
easing: {
|
|
15899
|
+
end: function () {
|
|
15900
|
+
_this.onEnd();
|
|
15901
|
+
}
|
|
15902
|
+
},
|
|
15903
|
+
stop: function () {
|
|
15904
|
+
_this.onStop();
|
|
15865
15905
|
}
|
|
15866
15906
|
}
|
|
15867
15907
|
});
|
|
15868
15908
|
}
|
|
15869
15909
|
}
|
|
15910
|
+
DViewGestureImpl.prototype.onStart = function () {
|
|
15911
|
+
var parent = this._parent;
|
|
15912
|
+
parent.stop();
|
|
15913
|
+
parent.emit("start", this, parent);
|
|
15914
|
+
};
|
|
15915
|
+
DViewGestureImpl.prototype.onEnd = function () {
|
|
15916
|
+
var parent = this._parent;
|
|
15917
|
+
parent.emit("end", this, parent);
|
|
15918
|
+
};
|
|
15919
|
+
DViewGestureImpl.prototype.onStop = function () {
|
|
15920
|
+
var parent = this._parent;
|
|
15921
|
+
parent.emit("stop", this, parent);
|
|
15922
|
+
};
|
|
15870
15923
|
DViewGestureImpl.prototype.onGestureMove = function (target, dx, dy, x, y, ds) {
|
|
15871
15924
|
if (target) {
|
|
15872
15925
|
// Scale
|
|
15873
|
-
var
|
|
15926
|
+
var parent_1 = this._parent;
|
|
15874
15927
|
var oldScale = target.scale;
|
|
15875
15928
|
var oldScaleX = oldScale.x;
|
|
15876
15929
|
var oldScaleY = oldScale.y;
|
|
15877
|
-
var newScaleX =
|
|
15878
|
-
var newScaleY =
|
|
15930
|
+
var newScaleX = parent_1.toNormalizedScale(oldScaleX * ds);
|
|
15931
|
+
var newScaleY = parent_1.toNormalizedScale(oldScaleY * ds);
|
|
15879
15932
|
var scaleRatioX = newScaleX / oldScaleX;
|
|
15880
15933
|
var scaleRatioY = newScaleY / oldScaleY;
|
|
15881
15934
|
var scaleRatio = ds < 1 ? Math.max(scaleRatioX, scaleRatioY) : Math.min(scaleRatioX, scaleRatioY);
|
|
@@ -15893,11 +15946,11 @@
|
|
|
15893
15946
|
};
|
|
15894
15947
|
DViewGestureImpl.prototype.stop = function () {
|
|
15895
15948
|
var _a;
|
|
15896
|
-
(_a = this._gestureUtil) === null || _a === void 0 ? void 0 : _a.stop(this.
|
|
15949
|
+
(_a = this._gestureUtil) === null || _a === void 0 ? void 0 : _a.stop(this._owner);
|
|
15897
15950
|
};
|
|
15898
15951
|
DViewGestureImpl.prototype.onDown = function (e) {
|
|
15899
15952
|
var _a;
|
|
15900
|
-
(_a = this._gestureUtil) === null || _a === void 0 ? void 0 : _a.onDown(this.
|
|
15953
|
+
(_a = this._gestureUtil) === null || _a === void 0 ? void 0 : _a.onDown(this._owner, e);
|
|
15901
15954
|
};
|
|
15902
15955
|
return DViewGestureImpl;
|
|
15903
15956
|
}());
|
|
@@ -15907,9 +15960,9 @@
|
|
|
15907
15960
|
* SPDX-License-Identifier: Apache-2.0
|
|
15908
15961
|
*/
|
|
15909
15962
|
var DViewTransformImpl = /** @class */ (function () {
|
|
15910
|
-
function DViewTransformImpl(
|
|
15963
|
+
function DViewTransformImpl(owner, toTarget, parent, constraint, duration) {
|
|
15911
15964
|
var _this = this;
|
|
15912
|
-
this.
|
|
15965
|
+
this._owner = owner;
|
|
15913
15966
|
this._toTarget = toTarget;
|
|
15914
15967
|
this._constraint = constraint;
|
|
15915
15968
|
this._newScaleX = 1;
|
|
@@ -15920,15 +15973,29 @@
|
|
|
15920
15973
|
this._oldScaleY = 1;
|
|
15921
15974
|
this._oldX = 0;
|
|
15922
15975
|
this._oldY = 0;
|
|
15976
|
+
this._isStarted = false;
|
|
15923
15977
|
this._animation = new DAnimationBase({
|
|
15978
|
+
onStart: function () {
|
|
15979
|
+
_this.onStart();
|
|
15980
|
+
},
|
|
15924
15981
|
onTime: function (time) {
|
|
15925
15982
|
_this.onTime(time);
|
|
15926
15983
|
},
|
|
15984
|
+
onEnd: function () {
|
|
15985
|
+
_this.onEnd();
|
|
15986
|
+
},
|
|
15987
|
+
onStop: function () {
|
|
15988
|
+
_this.onStop();
|
|
15989
|
+
},
|
|
15927
15990
|
duration: duration
|
|
15928
15991
|
});
|
|
15929
|
-
this.
|
|
15992
|
+
this._parent = parent;
|
|
15930
15993
|
this._duration = duration;
|
|
15931
15994
|
}
|
|
15995
|
+
DViewTransformImpl.prototype.onStart = function () {
|
|
15996
|
+
var parent = this._parent;
|
|
15997
|
+
parent.emit("start", this, parent);
|
|
15998
|
+
};
|
|
15932
15999
|
DViewTransformImpl.prototype.onTime = function (time) {
|
|
15933
16000
|
var w0 = 1 - time;
|
|
15934
16001
|
var w1 = time;
|
|
@@ -15936,20 +16003,31 @@
|
|
|
15936
16003
|
var scaleY = this._oldScaleY * w0 + this._newScaleY * w1;
|
|
15937
16004
|
var x = this._oldX * w0 + this._newX * w1;
|
|
15938
16005
|
var y = this._oldY * w0 + this._newY * w1;
|
|
15939
|
-
var target = this._toTarget(this.
|
|
16006
|
+
var target = this._toTarget(this._owner);
|
|
15940
16007
|
if (target != null) {
|
|
15941
16008
|
this._constraint(target, x, y, scaleX, scaleY);
|
|
15942
16009
|
}
|
|
15943
16010
|
};
|
|
16011
|
+
DViewTransformImpl.prototype.onEnd = function () {
|
|
16012
|
+
var parent = this._parent;
|
|
16013
|
+
parent.emit("end", this, parent);
|
|
16014
|
+
};
|
|
16015
|
+
DViewTransformImpl.prototype.onStop = function () {
|
|
16016
|
+
var parent = this._parent;
|
|
16017
|
+
parent.emit("stop", this, parent);
|
|
16018
|
+
};
|
|
15944
16019
|
DViewTransformImpl.prototype.start = function (target, x, y, scaleX, scaleY, duration, stop) {
|
|
16020
|
+
var parent = this._parent;
|
|
15945
16021
|
if (stop !== false) {
|
|
15946
|
-
|
|
16022
|
+
parent.stop();
|
|
15947
16023
|
}
|
|
15948
16024
|
if (duration == null) {
|
|
15949
16025
|
duration = this._duration;
|
|
15950
16026
|
}
|
|
15951
16027
|
if (duration <= 0) {
|
|
16028
|
+
this.onStart();
|
|
15952
16029
|
this._constraint(target, x, y, scaleX, scaleY);
|
|
16030
|
+
this.onEnd();
|
|
15953
16031
|
}
|
|
15954
16032
|
else {
|
|
15955
16033
|
var position = target.position;
|
|
@@ -15976,45 +16054,61 @@
|
|
|
15976
16054
|
* Copyright (C) 2019 Toshiba Corporation
|
|
15977
16055
|
* SPDX-License-Identifier: Apache-2.0
|
|
15978
16056
|
*/
|
|
15979
|
-
var DViewImpl = /** @class */ (function () {
|
|
16057
|
+
var DViewImpl = /** @class */ (function (_super) {
|
|
16058
|
+
__extends(DViewImpl, _super);
|
|
15980
16059
|
function DViewImpl(parent, toTarget, options) {
|
|
16060
|
+
var _this = this;
|
|
15981
16061
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
16062
|
+
_this = _super.call(this) || this;
|
|
16063
|
+
_this._parent = parent;
|
|
16064
|
+
_this._toTarget = toTarget;
|
|
16065
|
+
_this._constraint = (options && options.constraint) || DViewImpl.CONSTRAINT;
|
|
16066
|
+
_this._workRect = new pixi_js.Rectangle();
|
|
15986
16067
|
// Theme
|
|
15987
|
-
var theme =
|
|
16068
|
+
var theme = _this.toTheme(options) || _this.getThemeDefault();
|
|
15988
16069
|
// Zoom
|
|
15989
16070
|
var zoom = options === null || options === void 0 ? void 0 : options.zoom;
|
|
15990
|
-
|
|
15991
|
-
|
|
15992
|
-
|
|
15993
|
-
|
|
16071
|
+
_this._zoomPoint = new pixi_js.Point();
|
|
16072
|
+
_this._zoomMin = (_a = zoom === null || zoom === void 0 ? void 0 : zoom.min) !== null && _a !== void 0 ? _a : theme.getZoomMin();
|
|
16073
|
+
_this._zoomMax = (_b = zoom === null || zoom === void 0 ? void 0 : zoom.max) !== null && _b !== void 0 ? _b : theme.getZoomMax();
|
|
16074
|
+
_this._zoomKeepRatio = (_c = zoom === null || zoom === void 0 ? void 0 : zoom.keepRatio) !== null && _c !== void 0 ? _c : theme.getZoomKeepRatio();
|
|
15994
16075
|
// Zoom: Wheel
|
|
15995
16076
|
var wheelZoom = zoom === null || zoom === void 0 ? void 0 : zoom.wheel;
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
|
|
16077
|
+
_this._isWheelZoomEnabled = (_d = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.enable) !== null && _d !== void 0 ? _d : theme.isWheelZoomEnabled();
|
|
16078
|
+
_this._wheelZoomSpeed = (_e = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.speed) !== null && _e !== void 0 ? _e : theme.getWheelZoomSpeed();
|
|
16079
|
+
_this._wheelZoomModifier = toEnum((_f = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.modifier) !== null && _f !== void 0 ? _f : theme.getWheelZoomModifier(), UtilGestureModifier);
|
|
16080
|
+
_this._wheelZoomChecker = (_g = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.checker) !== null && _g !== void 0 ? _g : UtilGestureModifiers.match;
|
|
16000
16081
|
// Zoom: Dbl click
|
|
16001
16082
|
var dblClickZoom = zoom === null || zoom === void 0 ? void 0 : zoom.dblclick;
|
|
16002
|
-
|
|
16003
|
-
|
|
16004
|
-
|
|
16005
|
-
|
|
16006
|
-
|
|
16083
|
+
_this._isDblClickZoomEnabled = (_h = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.enable) !== null && _h !== void 0 ? _h : theme.isDblClickZoomEnabled();
|
|
16084
|
+
_this._dblClickZoomSpeed = (_j = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.amount) !== null && _j !== void 0 ? _j : theme.getDblClickZoomSpeed();
|
|
16085
|
+
_this._dblClickZoomModifier = toEnum((_k = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.modifier) !== null && _k !== void 0 ? _k : theme.getDblClickZoomModifier(), UtilGestureModifier);
|
|
16086
|
+
_this._dblClickZoomChecker = (_l = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.checker) !== null && _l !== void 0 ? _l : UtilGestureModifiers.match;
|
|
16087
|
+
_this._dblclickZoomDuration = (_m = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.duration) !== null && _m !== void 0 ? _m : theme.getDblClickZoomDuration();
|
|
16007
16088
|
// Translation: Wheel
|
|
16008
16089
|
var wheelTranslation = (_o = options === null || options === void 0 ? void 0 : options.translation) === null || _o === void 0 ? void 0 : _o.wheel;
|
|
16009
|
-
|
|
16090
|
+
_this._isWheelTranslationEnabled =
|
|
16010
16091
|
(_p = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.enable) !== null && _p !== void 0 ? _p : theme.isWheelTranslationEnabled();
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16092
|
+
_this._wheelTranslationSpeed = (_q = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.speed) !== null && _q !== void 0 ? _q : theme.getWheelTranslationSpeed();
|
|
16093
|
+
_this._wheelTranslationModifier = toEnum((_r = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.modifier) !== null && _r !== void 0 ? _r : theme.getWheelTranslationModifier(), UtilGestureModifier);
|
|
16094
|
+
_this._wheelTranslationChecker = (_s = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.checker) !== null && _s !== void 0 ? _s : UtilGestureModifiers.match;
|
|
16014
16095
|
// Gesture
|
|
16015
|
-
|
|
16096
|
+
_this._gesture = new DViewGestureImpl(parent, toTarget, _this, _this._constraint, theme, options === null || options === void 0 ? void 0 : options.gesture);
|
|
16016
16097
|
// Transform
|
|
16017
|
-
|
|
16098
|
+
_this._transform = new DViewTransformImpl(parent, toTarget, _this, _this._constraint, _this._dblclickZoomDuration);
|
|
16099
|
+
// Events
|
|
16100
|
+
if (options != null) {
|
|
16101
|
+
var on = options.on;
|
|
16102
|
+
if (on != null) {
|
|
16103
|
+
for (var name_1 in on) {
|
|
16104
|
+
var handler = on[name_1];
|
|
16105
|
+
if (handler) {
|
|
16106
|
+
_this.on(name_1, handler);
|
|
16107
|
+
}
|
|
16108
|
+
}
|
|
16109
|
+
}
|
|
16110
|
+
}
|
|
16111
|
+
return _this;
|
|
16018
16112
|
}
|
|
16019
16113
|
Object.defineProperty(DViewImpl.prototype, "gesture", {
|
|
16020
16114
|
get: function () {
|
|
@@ -16241,7 +16335,7 @@
|
|
|
16241
16335
|
target.position.set(x, y);
|
|
16242
16336
|
};
|
|
16243
16337
|
return DViewImpl;
|
|
16244
|
-
}());
|
|
16338
|
+
}(pixi_js.utils.EventEmitter));
|
|
16245
16339
|
|
|
16246
16340
|
/*
|
|
16247
16341
|
* Copyright (C) 2019 Toshiba Corporation
|
|
@@ -17866,6 +17960,9 @@
|
|
|
17866
17960
|
this._parent = parent;
|
|
17867
17961
|
this._onChange = onChange;
|
|
17868
17962
|
this._acceptor = new EShapeConnectorEdgeAcceptorImpl(this);
|
|
17963
|
+
this._acceptorTransformNew = new pixi_js.Matrix();
|
|
17964
|
+
this._acceptorTransformOld = new pixi_js.Matrix();
|
|
17965
|
+
this._hasAcceptorTransformOld = false;
|
|
17869
17966
|
this._local = new pixi_js.ObservablePoint(function () {
|
|
17870
17967
|
_this.onLocalChange();
|
|
17871
17968
|
}, undefined);
|
|
@@ -17878,6 +17975,7 @@
|
|
|
17878
17975
|
this._normalId = 0;
|
|
17879
17976
|
this._side = EShapeAcceptorEdgeSide.TOP;
|
|
17880
17977
|
this._margin = 0;
|
|
17978
|
+
this._other = null;
|
|
17881
17979
|
this._lockCount = 0;
|
|
17882
17980
|
this._isAcceptorChanged = false;
|
|
17883
17981
|
this._isLocalChanged = false;
|
|
@@ -17911,6 +18009,7 @@
|
|
|
17911
18009
|
isChanged = true;
|
|
17912
18010
|
}
|
|
17913
18011
|
if (this._isAcceptorChanged) {
|
|
18012
|
+
this._hasAcceptorTransformOld = false;
|
|
17914
18013
|
if (!this._isLocalChanged) {
|
|
17915
18014
|
this._localIdRequired += 1;
|
|
17916
18015
|
}
|
|
@@ -17994,6 +18093,16 @@
|
|
|
17994
18093
|
enumerable: false,
|
|
17995
18094
|
configurable: true
|
|
17996
18095
|
});
|
|
18096
|
+
Object.defineProperty(EShapeConnectorEdgeImpl.prototype, "other", {
|
|
18097
|
+
get: function () {
|
|
18098
|
+
return this._other;
|
|
18099
|
+
},
|
|
18100
|
+
set: function (other) {
|
|
18101
|
+
this._other = other;
|
|
18102
|
+
},
|
|
18103
|
+
enumerable: false,
|
|
18104
|
+
configurable: true
|
|
18105
|
+
});
|
|
17997
18106
|
EShapeConnectorEdgeImpl.prototype.set = function (acceptorShape, acceptorEdge, acceptorX, acceptorY, margin, x, y, nx, ny, side) {
|
|
17998
18107
|
this.lock();
|
|
17999
18108
|
this._acceptor.set(acceptorShape, acceptorEdge, acceptorX, acceptorY);
|
|
@@ -18095,7 +18204,7 @@
|
|
|
18095
18204
|
return this;
|
|
18096
18205
|
};
|
|
18097
18206
|
EShapeConnectorEdgeImpl.prototype.doFit = function () {
|
|
18098
|
-
var _a, _b;
|
|
18207
|
+
var _a, _b, _c;
|
|
18099
18208
|
var localIdRequired = this._localIdRequired;
|
|
18100
18209
|
var isLocalDirty = this._localId !== localIdRequired;
|
|
18101
18210
|
var normalIdRequired = this._normalIdRequired;
|
|
@@ -18109,35 +18218,82 @@
|
|
|
18109
18218
|
if (acceptorShape != null && acceptorEdge != null) {
|
|
18110
18219
|
var edge = EShapeAcceptors.get(acceptorShape.type).get(acceptorShape, acceptorEdge);
|
|
18111
18220
|
if (edge) {
|
|
18112
|
-
var
|
|
18113
|
-
var
|
|
18114
|
-
|
|
18115
|
-
var
|
|
18116
|
-
var
|
|
18117
|
-
|
|
18118
|
-
|
|
18221
|
+
var oat = this._acceptorTransformOld;
|
|
18222
|
+
var nat = this._acceptorTransformNew;
|
|
18223
|
+
this.toAcceptorTransform(acceptorShape, nat);
|
|
18224
|
+
var other = this._other;
|
|
18225
|
+
var isOtherDangling = this._hasAcceptorTransformOld &&
|
|
18226
|
+
other != null &&
|
|
18227
|
+
other.acceptor.shape == null;
|
|
18228
|
+
var work = ((_a = EShapeConnectorEdgeImpl.WORK_MATRIX) !== null && _a !== void 0 ? _a : (EShapeConnectorEdgeImpl.WORK_MATRIX = new pixi_js.Matrix()));
|
|
18229
|
+
if (isOtherDangling) {
|
|
18230
|
+
oat.copyTo(work).invert().prepend(nat);
|
|
18231
|
+
}
|
|
18232
|
+
this._acceptorTransformNew = oat;
|
|
18233
|
+
this._acceptorTransformOld = nat;
|
|
18234
|
+
this._hasAcceptorTransformOld = true;
|
|
18119
18235
|
this.lock();
|
|
18120
18236
|
if (isLocalDirty) {
|
|
18237
|
+
var l = this._local;
|
|
18238
|
+
var olx = l.x;
|
|
18239
|
+
var oly = l.y;
|
|
18121
18240
|
var size = acceptorShape.size;
|
|
18122
18241
|
var pivot = acceptorShape.transform.pivot;
|
|
18123
|
-
var
|
|
18124
|
-
var
|
|
18125
|
-
|
|
18242
|
+
var x = pivot.x + size.x * ((_b = acceptor.x) !== null && _b !== void 0 ? _b : edge.x);
|
|
18243
|
+
var y = pivot.y + size.y * ((_c = acceptor.y) !== null && _c !== void 0 ? _c : edge.y);
|
|
18244
|
+
var nlx = nat.a * x + nat.c * y + nat.tx;
|
|
18245
|
+
var nly = nat.b * x + nat.d * y + nat.ty;
|
|
18246
|
+
l.set(nlx, nly);
|
|
18247
|
+
if (isOtherDangling) {
|
|
18248
|
+
var ol = other.local;
|
|
18249
|
+
var oolx = ol.x;
|
|
18250
|
+
var ooly = ol.y;
|
|
18251
|
+
var nolx = work.a * oolx + work.c * ooly + work.tx;
|
|
18252
|
+
var noly = work.b * oolx + work.d * ooly + work.ty;
|
|
18253
|
+
var odx = oolx - olx;
|
|
18254
|
+
var ody = ooly - oly;
|
|
18255
|
+
var ndx = nolx - nlx;
|
|
18256
|
+
var ndy = noly - nly;
|
|
18257
|
+
var od = odx * odx + ody * ody;
|
|
18258
|
+
var nd = ndx * ndx + ndy * ndy;
|
|
18259
|
+
if (0.000001 < nd) {
|
|
18260
|
+
var f = Math.sqrt(od / nd);
|
|
18261
|
+
ol.set(nlx + ndx * f, nly + ndy * f);
|
|
18262
|
+
}
|
|
18263
|
+
else {
|
|
18264
|
+
ol.set(nolx, noly);
|
|
18265
|
+
}
|
|
18266
|
+
}
|
|
18126
18267
|
}
|
|
18127
18268
|
if (isNormalDirty) {
|
|
18128
|
-
var
|
|
18129
|
-
var
|
|
18130
|
-
var
|
|
18131
|
-
var
|
|
18132
|
-
var
|
|
18133
|
-
var
|
|
18134
|
-
var
|
|
18135
|
-
if (0.000001 <
|
|
18136
|
-
var f = 1 / Math.sqrt(
|
|
18137
|
-
|
|
18269
|
+
var en = edge.normal;
|
|
18270
|
+
var enx = en.x;
|
|
18271
|
+
var eny = en.y;
|
|
18272
|
+
var nx = nat.a * enx + nat.c * eny;
|
|
18273
|
+
var ny = nat.b * enx + nat.d * eny;
|
|
18274
|
+
var sd = nx * nx + ny * ny;
|
|
18275
|
+
var n = this._normal;
|
|
18276
|
+
if (0.000001 < sd) {
|
|
18277
|
+
var f = 1 / Math.sqrt(sd);
|
|
18278
|
+
n.set(nx * f, ny * f);
|
|
18138
18279
|
}
|
|
18139
18280
|
else {
|
|
18140
|
-
|
|
18281
|
+
n.set(enx, eny);
|
|
18282
|
+
}
|
|
18283
|
+
if (isOtherDangling) {
|
|
18284
|
+
var on = other.normal;
|
|
18285
|
+
var oonx = on.x;
|
|
18286
|
+
var oony = on.y;
|
|
18287
|
+
var nonx = work.a * oonx + work.c * oony;
|
|
18288
|
+
var nony = work.b * oonx + work.d * oony;
|
|
18289
|
+
var osd = nonx * nonx + nony * nony;
|
|
18290
|
+
if (0.000001 < osd) {
|
|
18291
|
+
var f = 1 / Math.sqrt(osd);
|
|
18292
|
+
on.set(nonx * f, nony * f);
|
|
18293
|
+
}
|
|
18294
|
+
else {
|
|
18295
|
+
on.set(oonx, oony);
|
|
18296
|
+
}
|
|
18141
18297
|
}
|
|
18142
18298
|
}
|
|
18143
18299
|
var result = this._isLocalChanged || this._isNormalChanged;
|
|
@@ -18148,20 +18304,19 @@
|
|
|
18148
18304
|
}
|
|
18149
18305
|
return false;
|
|
18150
18306
|
};
|
|
18151
|
-
EShapeConnectorEdgeImpl.prototype.toAcceptorTransform = function (shape) {
|
|
18152
|
-
var _a;
|
|
18307
|
+
EShapeConnectorEdgeImpl.prototype.toAcceptorTransform = function (shape, result) {
|
|
18153
18308
|
shape.updateTransform();
|
|
18154
18309
|
var parent = this._parent;
|
|
18155
18310
|
var parentParent = parent.parent;
|
|
18156
18311
|
if (parentParent) {
|
|
18157
18312
|
parent.updateTransform();
|
|
18158
|
-
return
|
|
18313
|
+
return result
|
|
18159
18314
|
.copyFrom(parentParent.transform.worldTransform)
|
|
18160
18315
|
.invert()
|
|
18161
18316
|
.append(shape.transform.worldTransform);
|
|
18162
18317
|
}
|
|
18163
18318
|
else {
|
|
18164
|
-
return shape.transform.worldTransform;
|
|
18319
|
+
return result.copyFrom(shape.transform.worldTransform);
|
|
18165
18320
|
}
|
|
18166
18321
|
};
|
|
18167
18322
|
EShapeConnectorEdgeImpl.prototype.onAcceptorChange = function () {
|
|
@@ -18171,6 +18326,7 @@
|
|
|
18171
18326
|
this._isAcceptorChanged = true;
|
|
18172
18327
|
return;
|
|
18173
18328
|
}
|
|
18329
|
+
this._hasAcceptorTransformOld = false;
|
|
18174
18330
|
this.fit(true);
|
|
18175
18331
|
};
|
|
18176
18332
|
EShapeConnectorEdgeImpl.prototype.onLocalChange = function () {
|
|
@@ -18229,8 +18385,12 @@
|
|
|
18229
18385
|
var onChangeBound = function () {
|
|
18230
18386
|
_this.onChange();
|
|
18231
18387
|
};
|
|
18232
|
-
|
|
18233
|
-
|
|
18388
|
+
var tail = new EShapeConnectorEdgeImpl(parent, onChangeBound);
|
|
18389
|
+
var head = new EShapeConnectorEdgeImpl(parent, onChangeBound);
|
|
18390
|
+
tail.other = head;
|
|
18391
|
+
head.other = tail;
|
|
18392
|
+
this._tail = tail;
|
|
18393
|
+
this._head = head;
|
|
18234
18394
|
}
|
|
18235
18395
|
EShapeConnectorEdgeContainerImpl.prototype.lock = function () {
|
|
18236
18396
|
this._lockCount += 1;
|