@visactor/vrender-core 1.1.0-alpha.20 → 1.1.0-alpha.21
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/cjs/canvas/constants.js +1 -2
- package/cjs/color-string/index.js +2 -1
- package/cjs/graphic/graphic.d.ts +1 -0
- package/cjs/graphic/graphic.js +9 -1
- package/cjs/graphic/graphic.js.map +1 -1
- package/dist/index.es.js +16 -0
- package/es/canvas/constants.js +1 -2
- package/es/color-string/index.js +2 -1
- package/es/graphic/graphic.d.ts +1 -0
- package/es/graphic/graphic.js +9 -1
- package/es/graphic/graphic.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -11540,6 +11540,7 @@ class Graphic extends Node {
|
|
|
11540
11540
|
}
|
|
11541
11541
|
const keys = Object.keys(params);
|
|
11542
11542
|
this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context);
|
|
11543
|
+
this.syncFinalAttributesFromUpdateContext(context);
|
|
11543
11544
|
this.visitTrackedAnimates(animate => {
|
|
11544
11545
|
if (animate.priority === Infinity && !ignorePriority) {
|
|
11545
11546
|
return;
|
|
@@ -11548,6 +11549,21 @@ class Graphic extends Node {
|
|
|
11548
11549
|
});
|
|
11549
11550
|
this.applyTransientAttributes(params, forceUpdateTag, context);
|
|
11550
11551
|
}
|
|
11552
|
+
syncFinalAttributesFromUpdateContext(context) {
|
|
11553
|
+
var _a;
|
|
11554
|
+
const updateType = context === null || context === void 0 ? void 0 : context.type;
|
|
11555
|
+
if (updateType === AttributeUpdateType.STATE ||
|
|
11556
|
+
(updateType != null &&
|
|
11557
|
+
updateType >= AttributeUpdateType.ANIMATE_BIND &&
|
|
11558
|
+
updateType <= AttributeUpdateType.ANIMATE_END)) {
|
|
11559
|
+
return;
|
|
11560
|
+
}
|
|
11561
|
+
const finalAttrs = (_a = this.context) === null || _a === void 0 ? void 0 : _a.finalAttrs;
|
|
11562
|
+
const setFinalAttributes = this.setFinalAttributes;
|
|
11563
|
+
if (finalAttrs && typeof setFinalAttributes === 'function') {
|
|
11564
|
+
setFinalAttributes.call(this, finalAttrs);
|
|
11565
|
+
}
|
|
11566
|
+
}
|
|
11551
11567
|
captureTransientFromAttrsBeforePreventAnimate(params, keys, context) {
|
|
11552
11568
|
var _a, _b;
|
|
11553
11569
|
const graphicContext = this.context;
|
package/es/canvas/constants.js
CHANGED
package/es/color-string/index.js
CHANGED
package/es/graphic/graphic.d.ts
CHANGED
|
@@ -223,6 +223,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
223
223
|
containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean;
|
|
224
224
|
protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds): void;
|
|
225
225
|
setAttributesAndPreventAnimate(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext, ignorePriority?: boolean): void;
|
|
226
|
+
protected syncFinalAttributesFromUpdateContext(context?: ISetAttributeContext): void;
|
|
226
227
|
protected captureTransientFromAttrsBeforePreventAnimate(params: Partial<T>, keys: string[], context?: ISetAttributeContext): void;
|
|
227
228
|
protected consumeTransientFromAttrsBeforePreventAnimate(diffAttrs: Record<string, any>): Record<string, any> | null;
|
|
228
229
|
setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
package/es/graphic/graphic.js
CHANGED
|
@@ -684,10 +684,18 @@ export class Graphic extends Node {
|
|
|
684
684
|
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
|
|
685
685
|
if (!params) return;
|
|
686
686
|
const keys = Object.keys(params);
|
|
687
|
-
this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context), this.
|
|
687
|
+
this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context), this.syncFinalAttributesFromUpdateContext(context),
|
|
688
|
+
this.visitTrackedAnimates((animate => {
|
|
688
689
|
(animate.priority !== 1 / 0 || ignorePriority) && animate.preventAttrs(keys);
|
|
689
690
|
})), this.applyTransientAttributes(params, forceUpdateTag, context);
|
|
690
691
|
}
|
|
692
|
+
syncFinalAttributesFromUpdateContext(context) {
|
|
693
|
+
var _a;
|
|
694
|
+
const updateType = null == context ? void 0 : context.type;
|
|
695
|
+
if (updateType === AttributeUpdateType.STATE || null != updateType && updateType >= AttributeUpdateType.ANIMATE_BIND && updateType <= AttributeUpdateType.ANIMATE_END) return;
|
|
696
|
+
const finalAttrs = null === (_a = this.context) || void 0 === _a ? void 0 : _a.finalAttrs, setFinalAttributes = this.setFinalAttributes;
|
|
697
|
+
finalAttrs && "function" == typeof setFinalAttributes && setFinalAttributes.call(this, finalAttrs);
|
|
698
|
+
}
|
|
691
699
|
captureTransientFromAttrsBeforePreventAnimate(params, keys, context) {
|
|
692
700
|
var _a, _b;
|
|
693
701
|
const graphicContext = this.context, diffAttrs = null !== (_a = null == graphicContext ? void 0 : graphicContext.diffAttrs) && void 0 !== _a ? _a : params, updateType = null == context ? void 0 : context.type;
|