@leafer-ui/draw 1.4.0 → 1.4.2
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/lib/draw.cjs +170 -165
- package/lib/draw.cjs.map +1 -1
- package/lib/draw.esm.js +171 -167
- package/lib/draw.esm.js.map +1 -1
- package/lib/draw.esm.min.js +1 -1
- package/lib/draw.esm.min.js.map +1 -1
- package/lib/draw.min.cjs +1 -1
- package/lib/draw.min.cjs.map +1 -1
- package/package.json +6 -6
package/lib/draw.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { decorateLeafAttr, attr,
|
|
1
|
+
import { defineKey, decorateLeafAttr, attr, Plugin, PathConvert, Debug, LeafData, canvasSizeAttrs, dataProcessor, dataType, surfaceType, opacityType, visibleType, sortType, maskType, eraserType, positionType, boundsType, scaleType, rotationType, autoLayoutType, naturalBoundsType, pathInputType, pathType, hitType, strokeType, cursorType, rewrite, Leaf, useModule, rewriteAble, MathHelper, pen, PathCorner, PathDrawer, UICreator, registerUI, Branch, LeafList, Resource, DataHelper, Creator, CanvasManager, WaitHelper, LeaferEvent, Bounds, ResizeEvent, AutoBounds, Run, LayoutEvent, RenderEvent, WatchEvent, ImageManager, BoundsHelper, affectRenderBoundsType, PathCommandDataHelper, Platform, PointHelper, PathBounds, affectStrokeBoundsType, getPointData, ImageEvent, LeaferImage, Matrix, PathCreator } from '@leafer/core';
|
|
2
2
|
export * from '@leafer/core';
|
|
3
3
|
|
|
4
4
|
/******************************************************************************
|
|
@@ -68,9 +68,7 @@ const TextConvert = {};
|
|
|
68
68
|
const ColorConvert = {};
|
|
69
69
|
const UnitConvert = {
|
|
70
70
|
number(value, percentRefer) {
|
|
71
|
-
|
|
72
|
-
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
73
|
-
return value;
|
|
71
|
+
return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value;
|
|
74
72
|
}
|
|
75
73
|
};
|
|
76
74
|
const PathArrow = {};
|
|
@@ -78,16 +76,15 @@ const Paint = {};
|
|
|
78
76
|
const PaintImage = {};
|
|
79
77
|
const PaintGradient = {};
|
|
80
78
|
const Effect = {};
|
|
79
|
+
const Filter = {
|
|
80
|
+
apply() { Plugin.need('filter'); }
|
|
81
|
+
};
|
|
81
82
|
const Export = {};
|
|
82
83
|
const State = {
|
|
83
|
-
setStyleName(
|
|
84
|
-
set(
|
|
85
|
-
};
|
|
86
|
-
const Transition = {
|
|
87
|
-
list: {},
|
|
88
|
-
register(attrName, fn) { Transition.list[attrName] = fn; },
|
|
89
|
-
get(attrName) { return Transition.list[attrName]; }
|
|
84
|
+
setStyleName() { return Plugin.need('state'); },
|
|
85
|
+
set() { return Plugin.need('state'); }
|
|
90
86
|
};
|
|
87
|
+
const Transition = {};
|
|
91
88
|
|
|
92
89
|
const { parse, objectToCanvasData } = PathConvert;
|
|
93
90
|
const emptyPaint = {};
|
|
@@ -194,24 +191,13 @@ class UIData extends LeafData {
|
|
|
194
191
|
}
|
|
195
192
|
}
|
|
196
193
|
setShadow(value) {
|
|
197
|
-
this
|
|
198
|
-
if (value instanceof Array) {
|
|
199
|
-
if (value.some((item) => item.visible === false))
|
|
200
|
-
value = value.filter((item) => item.visible !== false);
|
|
201
|
-
this._shadow = value.length ? value : null;
|
|
202
|
-
}
|
|
203
|
-
else
|
|
204
|
-
this._shadow = value && value.visible !== false ? [value] : null;
|
|
194
|
+
setArray(this, 'shadow', value);
|
|
205
195
|
}
|
|
206
196
|
setInnerShadow(value) {
|
|
207
|
-
this
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
this._innerShadow = value.length ? value : null;
|
|
212
|
-
}
|
|
213
|
-
else
|
|
214
|
-
this._innerShadow = value && value.visible !== false ? [value] : null;
|
|
197
|
+
setArray(this, 'innerShadow', value);
|
|
198
|
+
}
|
|
199
|
+
setFilter(value) {
|
|
200
|
+
setArray(this, 'filter', value);
|
|
215
201
|
}
|
|
216
202
|
__computePaint() {
|
|
217
203
|
const { fill, stroke } = this.__input;
|
|
@@ -222,6 +208,17 @@ class UIData extends LeafData {
|
|
|
222
208
|
this.__needComputePaint = false;
|
|
223
209
|
}
|
|
224
210
|
}
|
|
211
|
+
function setArray(data, key, value) {
|
|
212
|
+
data.__setInput(key, value);
|
|
213
|
+
if (value instanceof Array) {
|
|
214
|
+
if (value.some((item) => item.visible === false))
|
|
215
|
+
value = value.filter((item) => item.visible !== false);
|
|
216
|
+
value.length || (value = null);
|
|
217
|
+
}
|
|
218
|
+
else
|
|
219
|
+
value = value && value.visible !== false ? [value] : null;
|
|
220
|
+
data['_' + key] = value;
|
|
221
|
+
}
|
|
225
222
|
|
|
226
223
|
class GroupData extends UIData {
|
|
227
224
|
}
|
|
@@ -344,11 +341,13 @@ const UIBounds = {
|
|
|
344
341
|
},
|
|
345
342
|
__updateRenderSpread() {
|
|
346
343
|
let width = 0;
|
|
347
|
-
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
344
|
+
const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
|
|
348
345
|
if (shadow)
|
|
349
346
|
shadow.forEach(item => width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5));
|
|
350
347
|
if (blur)
|
|
351
348
|
width = Math.max(width, blur);
|
|
349
|
+
if (filter)
|
|
350
|
+
width += Filter.getSpread(filter);
|
|
352
351
|
let shapeWidth = width = Math.ceil(width);
|
|
353
352
|
if (innerShadow)
|
|
354
353
|
innerShadow.forEach(item => shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5));
|
|
@@ -363,8 +362,8 @@ const UIRender = {
|
|
|
363
362
|
__updateChange() {
|
|
364
363
|
const data = this.__;
|
|
365
364
|
if (data.__useEffect) {
|
|
366
|
-
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
367
|
-
data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur);
|
|
365
|
+
const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
|
|
366
|
+
data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter);
|
|
368
367
|
}
|
|
369
368
|
data.__checkSingle();
|
|
370
369
|
const complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect;
|
|
@@ -378,7 +377,7 @@ const UIRender = {
|
|
|
378
377
|
__drawFast(canvas, options) {
|
|
379
378
|
drawFast(this, canvas, options);
|
|
380
379
|
},
|
|
381
|
-
__draw(canvas, options) {
|
|
380
|
+
__draw(canvas, options, originCanvas) {
|
|
382
381
|
const data = this.__;
|
|
383
382
|
if (data.__complex) {
|
|
384
383
|
if (data.__needComputePaint)
|
|
@@ -388,7 +387,7 @@ const UIRender = {
|
|
|
388
387
|
if (data.__useEffect) {
|
|
389
388
|
const shape = Paint.shape(this, canvas, options);
|
|
390
389
|
this.__nowWorld = this.__getNowWorld(options);
|
|
391
|
-
const { shadow, innerShadow } = data;
|
|
390
|
+
const { shadow, innerShadow, filter } = data;
|
|
392
391
|
if (shadow)
|
|
393
392
|
Effect.shadow(this, canvas, shape);
|
|
394
393
|
if (fill)
|
|
@@ -399,6 +398,8 @@ const UIRender = {
|
|
|
399
398
|
Effect.innerShadow(this, canvas, shape);
|
|
400
399
|
if (stroke)
|
|
401
400
|
data.__isStrokes ? Paint.strokes(stroke, this, canvas) : Paint.stroke(stroke, this, canvas);
|
|
401
|
+
if (filter)
|
|
402
|
+
Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape);
|
|
402
403
|
if (shape.worldCanvas)
|
|
403
404
|
shape.worldCanvas.recycle();
|
|
404
405
|
shape.canvas.recycle();
|
|
@@ -618,199 +619,202 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
618
619
|
};
|
|
619
620
|
__decorate([
|
|
620
621
|
dataProcessor(UIData)
|
|
621
|
-
], UI.prototype, "__",
|
|
622
|
+
], UI.prototype, "__", void 0);
|
|
622
623
|
__decorate([
|
|
623
624
|
zoomLayerType()
|
|
624
|
-
], UI.prototype, "zoomLayer",
|
|
625
|
+
], UI.prototype, "zoomLayer", void 0);
|
|
625
626
|
__decorate([
|
|
626
627
|
dataType('')
|
|
627
|
-
], UI.prototype, "id",
|
|
628
|
+
], UI.prototype, "id", void 0);
|
|
628
629
|
__decorate([
|
|
629
630
|
dataType('')
|
|
630
|
-
], UI.prototype, "name",
|
|
631
|
+
], UI.prototype, "name", void 0);
|
|
631
632
|
__decorate([
|
|
632
633
|
dataType('')
|
|
633
|
-
], UI.prototype, "className",
|
|
634
|
+
], UI.prototype, "className", void 0);
|
|
634
635
|
__decorate([
|
|
635
636
|
surfaceType('pass-through')
|
|
636
|
-
], UI.prototype, "blendMode",
|
|
637
|
+
], UI.prototype, "blendMode", void 0);
|
|
637
638
|
__decorate([
|
|
638
639
|
opacityType(1)
|
|
639
|
-
], UI.prototype, "opacity",
|
|
640
|
+
], UI.prototype, "opacity", void 0);
|
|
640
641
|
__decorate([
|
|
641
642
|
visibleType(true)
|
|
642
|
-
], UI.prototype, "visible",
|
|
643
|
+
], UI.prototype, "visible", void 0);
|
|
643
644
|
__decorate([
|
|
644
645
|
surfaceType(false)
|
|
645
|
-
], UI.prototype, "locked",
|
|
646
|
+
], UI.prototype, "locked", void 0);
|
|
646
647
|
__decorate([
|
|
647
648
|
sortType(0)
|
|
648
|
-
], UI.prototype, "zIndex",
|
|
649
|
+
], UI.prototype, "zIndex", void 0);
|
|
649
650
|
__decorate([
|
|
650
651
|
maskType(false)
|
|
651
|
-
], UI.prototype, "mask",
|
|
652
|
+
], UI.prototype, "mask", void 0);
|
|
652
653
|
__decorate([
|
|
653
654
|
eraserType(false)
|
|
654
|
-
], UI.prototype, "eraser",
|
|
655
|
+
], UI.prototype, "eraser", void 0);
|
|
655
656
|
__decorate([
|
|
656
657
|
positionType(0, true)
|
|
657
|
-
], UI.prototype, "x",
|
|
658
|
+
], UI.prototype, "x", void 0);
|
|
658
659
|
__decorate([
|
|
659
660
|
positionType(0, true)
|
|
660
|
-
], UI.prototype, "y",
|
|
661
|
+
], UI.prototype, "y", void 0);
|
|
661
662
|
__decorate([
|
|
662
663
|
boundsType(100, true)
|
|
663
|
-
], UI.prototype, "width",
|
|
664
|
+
], UI.prototype, "width", void 0);
|
|
664
665
|
__decorate([
|
|
665
666
|
boundsType(100, true)
|
|
666
|
-
], UI.prototype, "height",
|
|
667
|
+
], UI.prototype, "height", void 0);
|
|
667
668
|
__decorate([
|
|
668
669
|
scaleType(1, true)
|
|
669
|
-
], UI.prototype, "scaleX",
|
|
670
|
+
], UI.prototype, "scaleX", void 0);
|
|
670
671
|
__decorate([
|
|
671
672
|
scaleType(1, true)
|
|
672
|
-
], UI.prototype, "scaleY",
|
|
673
|
+
], UI.prototype, "scaleY", void 0);
|
|
673
674
|
__decorate([
|
|
674
675
|
rotationType(0, true)
|
|
675
|
-
], UI.prototype, "rotation",
|
|
676
|
+
], UI.prototype, "rotation", void 0);
|
|
676
677
|
__decorate([
|
|
677
678
|
rotationType(0, true)
|
|
678
|
-
], UI.prototype, "skewX",
|
|
679
|
+
], UI.prototype, "skewX", void 0);
|
|
679
680
|
__decorate([
|
|
680
681
|
rotationType(0, true)
|
|
681
|
-
], UI.prototype, "skewY",
|
|
682
|
+
], UI.prototype, "skewY", void 0);
|
|
682
683
|
__decorate([
|
|
683
684
|
positionType(0, true)
|
|
684
|
-
], UI.prototype, "offsetX",
|
|
685
|
+
], UI.prototype, "offsetX", void 0);
|
|
685
686
|
__decorate([
|
|
686
687
|
positionType(0, true)
|
|
687
|
-
], UI.prototype, "offsetY",
|
|
688
|
+
], UI.prototype, "offsetY", void 0);
|
|
688
689
|
__decorate([
|
|
689
690
|
positionType(0, true)
|
|
690
|
-
], UI.prototype, "scrollX",
|
|
691
|
+
], UI.prototype, "scrollX", void 0);
|
|
691
692
|
__decorate([
|
|
692
693
|
positionType(0, true)
|
|
693
|
-
], UI.prototype, "scrollY",
|
|
694
|
+
], UI.prototype, "scrollY", void 0);
|
|
694
695
|
__decorate([
|
|
695
696
|
autoLayoutType()
|
|
696
|
-
], UI.prototype, "origin",
|
|
697
|
+
], UI.prototype, "origin", void 0);
|
|
697
698
|
__decorate([
|
|
698
699
|
autoLayoutType()
|
|
699
|
-
], UI.prototype, "around",
|
|
700
|
+
], UI.prototype, "around", void 0);
|
|
700
701
|
__decorate([
|
|
701
702
|
dataType(false)
|
|
702
|
-
], UI.prototype, "lazy",
|
|
703
|
+
], UI.prototype, "lazy", void 0);
|
|
703
704
|
__decorate([
|
|
704
705
|
naturalBoundsType(1)
|
|
705
|
-
], UI.prototype, "pixelRatio",
|
|
706
|
+
], UI.prototype, "pixelRatio", void 0);
|
|
706
707
|
__decorate([
|
|
707
708
|
pathInputType()
|
|
708
|
-
], UI.prototype, "path",
|
|
709
|
+
], UI.prototype, "path", void 0);
|
|
709
710
|
__decorate([
|
|
710
711
|
pathType()
|
|
711
|
-
], UI.prototype, "windingRule",
|
|
712
|
+
], UI.prototype, "windingRule", void 0);
|
|
712
713
|
__decorate([
|
|
713
714
|
pathType(true)
|
|
714
|
-
], UI.prototype, "closed",
|
|
715
|
+
], UI.prototype, "closed", void 0);
|
|
715
716
|
__decorate([
|
|
716
717
|
boundsType(0)
|
|
717
|
-
], UI.prototype, "padding",
|
|
718
|
+
], UI.prototype, "padding", void 0);
|
|
718
719
|
__decorate([
|
|
719
720
|
boundsType(false)
|
|
720
|
-
], UI.prototype, "lockRatio",
|
|
721
|
+
], UI.prototype, "lockRatio", void 0);
|
|
721
722
|
__decorate([
|
|
722
723
|
boundsType()
|
|
723
|
-
], UI.prototype, "widthRange",
|
|
724
|
+
], UI.prototype, "widthRange", void 0);
|
|
724
725
|
__decorate([
|
|
725
726
|
boundsType()
|
|
726
|
-
], UI.prototype, "heightRange",
|
|
727
|
+
], UI.prototype, "heightRange", void 0);
|
|
727
728
|
__decorate([
|
|
728
729
|
dataType(false)
|
|
729
|
-
], UI.prototype, "draggable",
|
|
730
|
+
], UI.prototype, "draggable", void 0);
|
|
730
731
|
__decorate([
|
|
731
732
|
dataType()
|
|
732
|
-
], UI.prototype, "dragBounds",
|
|
733
|
+
], UI.prototype, "dragBounds", void 0);
|
|
733
734
|
__decorate([
|
|
734
735
|
dataType(false)
|
|
735
|
-
], UI.prototype, "editable",
|
|
736
|
+
], UI.prototype, "editable", void 0);
|
|
736
737
|
__decorate([
|
|
737
738
|
hitType(true)
|
|
738
|
-
], UI.prototype, "hittable",
|
|
739
|
+
], UI.prototype, "hittable", void 0);
|
|
739
740
|
__decorate([
|
|
740
741
|
hitType('path')
|
|
741
|
-
], UI.prototype, "hitFill",
|
|
742
|
+
], UI.prototype, "hitFill", void 0);
|
|
742
743
|
__decorate([
|
|
743
744
|
strokeType('path')
|
|
744
|
-
], UI.prototype, "hitStroke",
|
|
745
|
+
], UI.prototype, "hitStroke", void 0);
|
|
745
746
|
__decorate([
|
|
746
747
|
hitType(false)
|
|
747
|
-
], UI.prototype, "hitBox",
|
|
748
|
+
], UI.prototype, "hitBox", void 0);
|
|
748
749
|
__decorate([
|
|
749
750
|
hitType(true)
|
|
750
|
-
], UI.prototype, "hitChildren",
|
|
751
|
+
], UI.prototype, "hitChildren", void 0);
|
|
751
752
|
__decorate([
|
|
752
753
|
hitType(true)
|
|
753
|
-
], UI.prototype, "hitSelf",
|
|
754
|
+
], UI.prototype, "hitSelf", void 0);
|
|
754
755
|
__decorate([
|
|
755
756
|
hitType()
|
|
756
|
-
], UI.prototype, "hitRadius",
|
|
757
|
+
], UI.prototype, "hitRadius", void 0);
|
|
757
758
|
__decorate([
|
|
758
759
|
cursorType('')
|
|
759
|
-
], UI.prototype, "cursor",
|
|
760
|
+
], UI.prototype, "cursor", void 0);
|
|
760
761
|
__decorate([
|
|
761
762
|
surfaceType()
|
|
762
|
-
], UI.prototype, "fill",
|
|
763
|
+
], UI.prototype, "fill", void 0);
|
|
763
764
|
__decorate([
|
|
764
765
|
strokeType()
|
|
765
|
-
], UI.prototype, "stroke",
|
|
766
|
+
], UI.prototype, "stroke", void 0);
|
|
766
767
|
__decorate([
|
|
767
768
|
strokeType('inside')
|
|
768
|
-
], UI.prototype, "strokeAlign",
|
|
769
|
+
], UI.prototype, "strokeAlign", void 0);
|
|
769
770
|
__decorate([
|
|
770
771
|
strokeType(1)
|
|
771
|
-
], UI.prototype, "strokeWidth",
|
|
772
|
+
], UI.prototype, "strokeWidth", void 0);
|
|
772
773
|
__decorate([
|
|
773
774
|
strokeType(false)
|
|
774
|
-
], UI.prototype, "strokeWidthFixed",
|
|
775
|
+
], UI.prototype, "strokeWidthFixed", void 0);
|
|
775
776
|
__decorate([
|
|
776
777
|
strokeType('none')
|
|
777
|
-
], UI.prototype, "strokeCap",
|
|
778
|
+
], UI.prototype, "strokeCap", void 0);
|
|
778
779
|
__decorate([
|
|
779
780
|
strokeType('miter')
|
|
780
|
-
], UI.prototype, "strokeJoin",
|
|
781
|
+
], UI.prototype, "strokeJoin", void 0);
|
|
781
782
|
__decorate([
|
|
782
783
|
strokeType()
|
|
783
|
-
], UI.prototype, "dashPattern",
|
|
784
|
+
], UI.prototype, "dashPattern", void 0);
|
|
784
785
|
__decorate([
|
|
785
786
|
strokeType()
|
|
786
|
-
], UI.prototype, "dashOffset",
|
|
787
|
+
], UI.prototype, "dashOffset", void 0);
|
|
787
788
|
__decorate([
|
|
788
789
|
strokeType(10)
|
|
789
|
-
], UI.prototype, "miterLimit",
|
|
790
|
+
], UI.prototype, "miterLimit", void 0);
|
|
790
791
|
__decorate([
|
|
791
792
|
pathType(0)
|
|
792
|
-
], UI.prototype, "cornerRadius",
|
|
793
|
+
], UI.prototype, "cornerRadius", void 0);
|
|
793
794
|
__decorate([
|
|
794
795
|
pathType()
|
|
795
|
-
], UI.prototype, "cornerSmoothing",
|
|
796
|
+
], UI.prototype, "cornerSmoothing", void 0);
|
|
797
|
+
__decorate([
|
|
798
|
+
effectType()
|
|
799
|
+
], UI.prototype, "shadow", void 0);
|
|
796
800
|
__decorate([
|
|
797
801
|
effectType()
|
|
798
|
-
], UI.prototype, "
|
|
802
|
+
], UI.prototype, "innerShadow", void 0);
|
|
799
803
|
__decorate([
|
|
800
804
|
effectType()
|
|
801
|
-
], UI.prototype, "
|
|
805
|
+
], UI.prototype, "blur", void 0);
|
|
802
806
|
__decorate([
|
|
803
807
|
effectType()
|
|
804
|
-
], UI.prototype, "
|
|
808
|
+
], UI.prototype, "backgroundBlur", void 0);
|
|
805
809
|
__decorate([
|
|
806
810
|
effectType()
|
|
807
|
-
], UI.prototype, "
|
|
811
|
+
], UI.prototype, "grayscale", void 0);
|
|
808
812
|
__decorate([
|
|
809
813
|
effectType()
|
|
810
|
-
], UI.prototype, "
|
|
814
|
+
], UI.prototype, "filter", void 0);
|
|
811
815
|
__decorate([
|
|
812
816
|
dataType({})
|
|
813
|
-
], UI.prototype, "data",
|
|
817
|
+
], UI.prototype, "data", void 0);
|
|
814
818
|
__decorate([
|
|
815
819
|
rewrite(Leaf.prototype.reset)
|
|
816
820
|
], UI.prototype, "reset", null);
|
|
@@ -871,7 +875,7 @@ let Group = class Group extends UI {
|
|
|
871
875
|
};
|
|
872
876
|
__decorate([
|
|
873
877
|
dataProcessor(GroupData)
|
|
874
|
-
], Group.prototype, "__",
|
|
878
|
+
], Group.prototype, "__", void 0);
|
|
875
879
|
Group = __decorate([
|
|
876
880
|
useModule(Branch),
|
|
877
881
|
registerUI()
|
|
@@ -884,7 +888,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
884
888
|
get isApp() { return false; }
|
|
885
889
|
get app() { return this.parent || this; }
|
|
886
890
|
get isLeafer() { return true; }
|
|
887
|
-
get imageReady() { return this.viewReady &&
|
|
891
|
+
get imageReady() { return this.viewReady && Resource.isComplete; }
|
|
888
892
|
get layoutLocked() { return !this.layouter.running; }
|
|
889
893
|
get FPS() { return this.renderer ? this.renderer.FPS : 60; }
|
|
890
894
|
get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
|
|
@@ -1095,13 +1099,13 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
1095
1099
|
WaitHelper.run(this.__viewReadyWait);
|
|
1096
1100
|
}
|
|
1097
1101
|
__onLayoutEnd() {
|
|
1098
|
-
const { grow,
|
|
1102
|
+
const { grow, width: fixedWidth, height: fixedHeight } = this.config;
|
|
1099
1103
|
if (grow) {
|
|
1100
1104
|
let { width, height, pixelRatio } = this;
|
|
1101
1105
|
const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
|
|
1102
|
-
if (
|
|
1106
|
+
if (!fixedWidth)
|
|
1103
1107
|
width = Math.max(1, bounds.x + bounds.width);
|
|
1104
|
-
if (
|
|
1108
|
+
if (!fixedHeight)
|
|
1105
1109
|
height = Math.max(1, bounds.y + bounds.height);
|
|
1106
1110
|
this.__doResize({ width, height, pixelRatio });
|
|
1107
1111
|
}
|
|
@@ -1179,7 +1183,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
1179
1183
|
list.push(item);
|
|
1180
1184
|
this.requestRender();
|
|
1181
1185
|
}
|
|
1182
|
-
zoom(_zoomType, _padding, _fixedScale) {
|
|
1186
|
+
zoom(_zoomType, _padding, _fixedScale, _transition) {
|
|
1183
1187
|
return Plugin.need('view');
|
|
1184
1188
|
}
|
|
1185
1189
|
getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
|
|
@@ -1244,10 +1248,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
1244
1248
|
Leafer.list = new LeafList();
|
|
1245
1249
|
__decorate([
|
|
1246
1250
|
dataProcessor(LeaferData)
|
|
1247
|
-
], Leafer.prototype, "__",
|
|
1251
|
+
], Leafer.prototype, "__", void 0);
|
|
1248
1252
|
__decorate([
|
|
1249
1253
|
boundsType()
|
|
1250
|
-
], Leafer.prototype, "pixelRatio",
|
|
1254
|
+
], Leafer.prototype, "pixelRatio", void 0);
|
|
1251
1255
|
Leafer = Leafer_1 = __decorate([
|
|
1252
1256
|
registerUI()
|
|
1253
1257
|
], Leafer);
|
|
@@ -1260,7 +1264,7 @@ let Rect = class Rect extends UI {
|
|
|
1260
1264
|
};
|
|
1261
1265
|
__decorate([
|
|
1262
1266
|
dataProcessor(RectData)
|
|
1263
|
-
], Rect.prototype, "__",
|
|
1267
|
+
], Rect.prototype, "__", void 0);
|
|
1264
1268
|
Rect = __decorate([
|
|
1265
1269
|
useModule(RectRender),
|
|
1266
1270
|
rewriteAble(),
|
|
@@ -1351,13 +1355,13 @@ let Box = class Box extends Group {
|
|
|
1351
1355
|
};
|
|
1352
1356
|
__decorate([
|
|
1353
1357
|
dataProcessor(BoxData)
|
|
1354
|
-
], Box.prototype, "__",
|
|
1358
|
+
], Box.prototype, "__", void 0);
|
|
1355
1359
|
__decorate([
|
|
1356
1360
|
dataType(false)
|
|
1357
|
-
], Box.prototype, "resizeChildren",
|
|
1361
|
+
], Box.prototype, "resizeChildren", void 0);
|
|
1358
1362
|
__decorate([
|
|
1359
1363
|
affectRenderBoundsType('show')
|
|
1360
|
-
], Box.prototype, "overflow",
|
|
1364
|
+
], Box.prototype, "overflow", void 0);
|
|
1361
1365
|
__decorate([
|
|
1362
1366
|
rewrite(rect.__updateStrokeSpread)
|
|
1363
1367
|
], Box.prototype, "__updateStrokeSpread", null);
|
|
@@ -1396,13 +1400,13 @@ let Frame = class Frame extends Box {
|
|
|
1396
1400
|
};
|
|
1397
1401
|
__decorate([
|
|
1398
1402
|
dataProcessor(FrameData)
|
|
1399
|
-
], Frame.prototype, "__",
|
|
1403
|
+
], Frame.prototype, "__", void 0);
|
|
1400
1404
|
__decorate([
|
|
1401
1405
|
surfaceType('#FFFFFF')
|
|
1402
|
-
], Frame.prototype, "fill",
|
|
1406
|
+
], Frame.prototype, "fill", void 0);
|
|
1403
1407
|
__decorate([
|
|
1404
1408
|
affectRenderBoundsType('hide')
|
|
1405
|
-
], Frame.prototype, "overflow",
|
|
1409
|
+
], Frame.prototype, "overflow", void 0);
|
|
1406
1410
|
Frame = __decorate([
|
|
1407
1411
|
registerUI()
|
|
1408
1412
|
], Frame);
|
|
@@ -1449,16 +1453,16 @@ let Ellipse = class Ellipse extends UI {
|
|
|
1449
1453
|
};
|
|
1450
1454
|
__decorate([
|
|
1451
1455
|
dataProcessor(EllipseData)
|
|
1452
|
-
], Ellipse.prototype, "__",
|
|
1456
|
+
], Ellipse.prototype, "__", void 0);
|
|
1453
1457
|
__decorate([
|
|
1454
1458
|
pathType(0)
|
|
1455
|
-
], Ellipse.prototype, "innerRadius",
|
|
1459
|
+
], Ellipse.prototype, "innerRadius", void 0);
|
|
1456
1460
|
__decorate([
|
|
1457
1461
|
pathType(0)
|
|
1458
|
-
], Ellipse.prototype, "startAngle",
|
|
1462
|
+
], Ellipse.prototype, "startAngle", void 0);
|
|
1459
1463
|
__decorate([
|
|
1460
1464
|
pathType(0)
|
|
1461
|
-
], Ellipse.prototype, "endAngle",
|
|
1465
|
+
], Ellipse.prototype, "endAngle", void 0);
|
|
1462
1466
|
Ellipse = __decorate([
|
|
1463
1467
|
registerUI()
|
|
1464
1468
|
], Ellipse);
|
|
@@ -1517,22 +1521,22 @@ let Line = class Line extends UI {
|
|
|
1517
1521
|
};
|
|
1518
1522
|
__decorate([
|
|
1519
1523
|
dataProcessor(LineData)
|
|
1520
|
-
], Line.prototype, "__",
|
|
1524
|
+
], Line.prototype, "__", void 0);
|
|
1521
1525
|
__decorate([
|
|
1522
1526
|
affectStrokeBoundsType('center')
|
|
1523
|
-
], Line.prototype, "strokeAlign",
|
|
1527
|
+
], Line.prototype, "strokeAlign", void 0);
|
|
1524
1528
|
__decorate([
|
|
1525
1529
|
boundsType(0)
|
|
1526
|
-
], Line.prototype, "height",
|
|
1530
|
+
], Line.prototype, "height", void 0);
|
|
1527
1531
|
__decorate([
|
|
1528
1532
|
pathType()
|
|
1529
|
-
], Line.prototype, "points",
|
|
1533
|
+
], Line.prototype, "points", void 0);
|
|
1530
1534
|
__decorate([
|
|
1531
1535
|
pathType(0)
|
|
1532
|
-
], Line.prototype, "curve",
|
|
1536
|
+
], Line.prototype, "curve", void 0);
|
|
1533
1537
|
__decorate([
|
|
1534
1538
|
pathType(false)
|
|
1535
|
-
], Line.prototype, "closed",
|
|
1539
|
+
], Line.prototype, "closed", void 0);
|
|
1536
1540
|
Line = __decorate([
|
|
1537
1541
|
registerUI()
|
|
1538
1542
|
], Line);
|
|
@@ -1565,16 +1569,16 @@ let Polygon = class Polygon extends UI {
|
|
|
1565
1569
|
};
|
|
1566
1570
|
__decorate([
|
|
1567
1571
|
dataProcessor(PolygonData)
|
|
1568
|
-
], Polygon.prototype, "__",
|
|
1572
|
+
], Polygon.prototype, "__", void 0);
|
|
1569
1573
|
__decorate([
|
|
1570
1574
|
pathType(3)
|
|
1571
|
-
], Polygon.prototype, "sides",
|
|
1575
|
+
], Polygon.prototype, "sides", void 0);
|
|
1572
1576
|
__decorate([
|
|
1573
1577
|
pathType()
|
|
1574
|
-
], Polygon.prototype, "points",
|
|
1578
|
+
], Polygon.prototype, "points", void 0);
|
|
1575
1579
|
__decorate([
|
|
1576
1580
|
pathType(0)
|
|
1577
|
-
], Polygon.prototype, "curve",
|
|
1581
|
+
], Polygon.prototype, "curve", void 0);
|
|
1578
1582
|
__decorate([
|
|
1579
1583
|
rewrite(line.__updateRenderPath)
|
|
1580
1584
|
], Polygon.prototype, "__updateRenderPath", null);
|
|
@@ -1606,13 +1610,13 @@ let Star = class Star extends UI {
|
|
|
1606
1610
|
};
|
|
1607
1611
|
__decorate([
|
|
1608
1612
|
dataProcessor(StarData)
|
|
1609
|
-
], Star.prototype, "__",
|
|
1613
|
+
], Star.prototype, "__", void 0);
|
|
1610
1614
|
__decorate([
|
|
1611
1615
|
pathType(5)
|
|
1612
|
-
], Star.prototype, "corners",
|
|
1616
|
+
], Star.prototype, "corners", void 0);
|
|
1613
1617
|
__decorate([
|
|
1614
1618
|
pathType(0.382)
|
|
1615
|
-
], Star.prototype, "innerRadius",
|
|
1619
|
+
], Star.prototype, "innerRadius", void 0);
|
|
1616
1620
|
Star = __decorate([
|
|
1617
1621
|
registerUI()
|
|
1618
1622
|
], Star);
|
|
@@ -1634,10 +1638,10 @@ let Image = class Image extends Rect {
|
|
|
1634
1638
|
};
|
|
1635
1639
|
__decorate([
|
|
1636
1640
|
dataProcessor(ImageData)
|
|
1637
|
-
], Image.prototype, "__",
|
|
1641
|
+
], Image.prototype, "__", void 0);
|
|
1638
1642
|
__decorate([
|
|
1639
1643
|
boundsType('')
|
|
1640
|
-
], Image.prototype, "url",
|
|
1644
|
+
], Image.prototype, "url", void 0);
|
|
1641
1645
|
Image = __decorate([
|
|
1642
1646
|
registerUI()
|
|
1643
1647
|
], Image);
|
|
@@ -1700,25 +1704,25 @@ let Canvas = class Canvas extends Rect {
|
|
|
1700
1704
|
};
|
|
1701
1705
|
__decorate([
|
|
1702
1706
|
dataProcessor(CanvasData)
|
|
1703
|
-
], Canvas.prototype, "__",
|
|
1707
|
+
], Canvas.prototype, "__", void 0);
|
|
1704
1708
|
__decorate([
|
|
1705
1709
|
resizeType(100)
|
|
1706
|
-
], Canvas.prototype, "width",
|
|
1710
|
+
], Canvas.prototype, "width", void 0);
|
|
1707
1711
|
__decorate([
|
|
1708
1712
|
resizeType(100)
|
|
1709
|
-
], Canvas.prototype, "height",
|
|
1713
|
+
], Canvas.prototype, "height", void 0);
|
|
1710
1714
|
__decorate([
|
|
1711
1715
|
resizeType(1)
|
|
1712
|
-
], Canvas.prototype, "pixelRatio",
|
|
1716
|
+
], Canvas.prototype, "pixelRatio", void 0);
|
|
1713
1717
|
__decorate([
|
|
1714
1718
|
resizeType(true)
|
|
1715
|
-
], Canvas.prototype, "smooth",
|
|
1719
|
+
], Canvas.prototype, "smooth", void 0);
|
|
1716
1720
|
__decorate([
|
|
1717
1721
|
dataType(false)
|
|
1718
|
-
], Canvas.prototype, "safeResize",
|
|
1722
|
+
], Canvas.prototype, "safeResize", void 0);
|
|
1719
1723
|
__decorate([
|
|
1720
1724
|
resizeType()
|
|
1721
|
-
], Canvas.prototype, "contextSettings",
|
|
1725
|
+
], Canvas.prototype, "contextSettings", void 0);
|
|
1722
1726
|
Canvas = __decorate([
|
|
1723
1727
|
registerUI()
|
|
1724
1728
|
], Canvas);
|
|
@@ -1809,76 +1813,76 @@ let Text = class Text extends UI {
|
|
|
1809
1813
|
};
|
|
1810
1814
|
__decorate([
|
|
1811
1815
|
dataProcessor(TextData)
|
|
1812
|
-
], Text.prototype, "__",
|
|
1816
|
+
], Text.prototype, "__", void 0);
|
|
1813
1817
|
__decorate([
|
|
1814
1818
|
boundsType(0)
|
|
1815
|
-
], Text.prototype, "width",
|
|
1819
|
+
], Text.prototype, "width", void 0);
|
|
1816
1820
|
__decorate([
|
|
1817
1821
|
boundsType(0)
|
|
1818
|
-
], Text.prototype, "height",
|
|
1822
|
+
], Text.prototype, "height", void 0);
|
|
1819
1823
|
__decorate([
|
|
1820
1824
|
dataType(false)
|
|
1821
|
-
], Text.prototype, "resizeFontSize",
|
|
1825
|
+
], Text.prototype, "resizeFontSize", void 0);
|
|
1822
1826
|
__decorate([
|
|
1823
1827
|
surfaceType('#000000')
|
|
1824
|
-
], Text.prototype, "fill",
|
|
1828
|
+
], Text.prototype, "fill", void 0);
|
|
1825
1829
|
__decorate([
|
|
1826
1830
|
affectStrokeBoundsType('outside')
|
|
1827
|
-
], Text.prototype, "strokeAlign",
|
|
1831
|
+
], Text.prototype, "strokeAlign", void 0);
|
|
1828
1832
|
__decorate([
|
|
1829
1833
|
hitType('all')
|
|
1830
|
-
], Text.prototype, "hitFill",
|
|
1834
|
+
], Text.prototype, "hitFill", void 0);
|
|
1831
1835
|
__decorate([
|
|
1832
1836
|
boundsType('')
|
|
1833
|
-
], Text.prototype, "text",
|
|
1837
|
+
], Text.prototype, "text", void 0);
|
|
1834
1838
|
__decorate([
|
|
1835
1839
|
boundsType('caption')
|
|
1836
|
-
], Text.prototype, "fontFamily",
|
|
1840
|
+
], Text.prototype, "fontFamily", void 0);
|
|
1837
1841
|
__decorate([
|
|
1838
1842
|
boundsType(12)
|
|
1839
|
-
], Text.prototype, "fontSize",
|
|
1843
|
+
], Text.prototype, "fontSize", void 0);
|
|
1840
1844
|
__decorate([
|
|
1841
1845
|
boundsType('normal')
|
|
1842
|
-
], Text.prototype, "fontWeight",
|
|
1846
|
+
], Text.prototype, "fontWeight", void 0);
|
|
1843
1847
|
__decorate([
|
|
1844
1848
|
boundsType(false)
|
|
1845
|
-
], Text.prototype, "italic",
|
|
1849
|
+
], Text.prototype, "italic", void 0);
|
|
1846
1850
|
__decorate([
|
|
1847
1851
|
boundsType('none')
|
|
1848
|
-
], Text.prototype, "textCase",
|
|
1852
|
+
], Text.prototype, "textCase", void 0);
|
|
1849
1853
|
__decorate([
|
|
1850
1854
|
boundsType('none')
|
|
1851
|
-
], Text.prototype, "textDecoration",
|
|
1855
|
+
], Text.prototype, "textDecoration", void 0);
|
|
1852
1856
|
__decorate([
|
|
1853
1857
|
boundsType(0)
|
|
1854
|
-
], Text.prototype, "letterSpacing",
|
|
1858
|
+
], Text.prototype, "letterSpacing", void 0);
|
|
1855
1859
|
__decorate([
|
|
1856
1860
|
boundsType({ type: 'percent', value: 1.5 })
|
|
1857
|
-
], Text.prototype, "lineHeight",
|
|
1861
|
+
], Text.prototype, "lineHeight", void 0);
|
|
1858
1862
|
__decorate([
|
|
1859
1863
|
boundsType(0)
|
|
1860
|
-
], Text.prototype, "paraIndent",
|
|
1864
|
+
], Text.prototype, "paraIndent", void 0);
|
|
1861
1865
|
__decorate([
|
|
1862
1866
|
boundsType(0)
|
|
1863
|
-
], Text.prototype, "paraSpacing",
|
|
1867
|
+
], Text.prototype, "paraSpacing", void 0);
|
|
1864
1868
|
__decorate([
|
|
1865
1869
|
boundsType('x')
|
|
1866
|
-
], Text.prototype, "writingMode",
|
|
1870
|
+
], Text.prototype, "writingMode", void 0);
|
|
1867
1871
|
__decorate([
|
|
1868
1872
|
boundsType('left')
|
|
1869
|
-
], Text.prototype, "textAlign",
|
|
1873
|
+
], Text.prototype, "textAlign", void 0);
|
|
1870
1874
|
__decorate([
|
|
1871
1875
|
boundsType('top')
|
|
1872
|
-
], Text.prototype, "verticalAlign",
|
|
1876
|
+
], Text.prototype, "verticalAlign", void 0);
|
|
1873
1877
|
__decorate([
|
|
1874
1878
|
boundsType(true)
|
|
1875
|
-
], Text.prototype, "autoSizeAlign",
|
|
1879
|
+
], Text.prototype, "autoSizeAlign", void 0);
|
|
1876
1880
|
__decorate([
|
|
1877
1881
|
boundsType('normal')
|
|
1878
|
-
], Text.prototype, "textWrap",
|
|
1882
|
+
], Text.prototype, "textWrap", void 0);
|
|
1879
1883
|
__decorate([
|
|
1880
1884
|
boundsType('show')
|
|
1881
|
-
], Text.prototype, "textOverflow",
|
|
1885
|
+
], Text.prototype, "textOverflow", void 0);
|
|
1882
1886
|
Text = __decorate([
|
|
1883
1887
|
registerUI()
|
|
1884
1888
|
], Text);
|
|
@@ -1891,10 +1895,10 @@ let Path = class Path extends UI {
|
|
|
1891
1895
|
};
|
|
1892
1896
|
__decorate([
|
|
1893
1897
|
dataProcessor(PathData)
|
|
1894
|
-
], Path.prototype, "__",
|
|
1898
|
+
], Path.prototype, "__", void 0);
|
|
1895
1899
|
__decorate([
|
|
1896
1900
|
affectStrokeBoundsType('center')
|
|
1897
|
-
], Path.prototype, "strokeAlign",
|
|
1901
|
+
], Path.prototype, "strokeAlign", void 0);
|
|
1898
1902
|
Path = __decorate([
|
|
1899
1903
|
registerUI()
|
|
1900
1904
|
], Path);
|
|
@@ -1933,10 +1937,10 @@ let Pen = class Pen extends Group {
|
|
|
1933
1937
|
};
|
|
1934
1938
|
__decorate([
|
|
1935
1939
|
dataProcessor(PenData)
|
|
1936
|
-
], Pen.prototype, "__",
|
|
1940
|
+
], Pen.prototype, "__", void 0);
|
|
1937
1941
|
__decorate([
|
|
1938
1942
|
penPathType()
|
|
1939
|
-
], Pen.prototype, "path",
|
|
1943
|
+
], Pen.prototype, "path", void 0);
|
|
1940
1944
|
Pen = __decorate([
|
|
1941
1945
|
useModule(PathCreator, ['set', 'path', 'paint']),
|
|
1942
1946
|
registerUI()
|
|
@@ -1949,5 +1953,5 @@ function penPathType() {
|
|
|
1949
1953
|
};
|
|
1950
1954
|
}
|
|
1951
1955
|
|
|
1952
|
-
export { Box, BoxData, Canvas, CanvasData, ColorConvert, Effect, Ellipse, EllipseData, Export, Frame, FrameData, Group, GroupData, Image, ImageData, Leafer, LeaferData, Line, LineData, MyImage, Paint, PaintGradient, PaintImage, Path, PathArrow, PathData, Pen, PenData, Polygon, PolygonData, Rect, RectData, RectRender, Star, StarData, State, Text, TextConvert, TextData, Transition, UI, UIBounds, UIData, UIRender, UnitConvert, effectType, resizeType, zoomLayerType };
|
|
1956
|
+
export { Box, BoxData, Canvas, CanvasData, ColorConvert, Effect, Ellipse, EllipseData, Export, Filter, Frame, FrameData, Group, GroupData, Image, ImageData, Leafer, LeaferData, Line, LineData, MyImage, Paint, PaintGradient, PaintImage, Path, PathArrow, PathData, Pen, PenData, Polygon, PolygonData, Rect, RectData, RectRender, Star, StarData, State, Text, TextConvert, TextData, Transition, UI, UIBounds, UIData, UIRender, UnitConvert, effectType, resizeType, zoomLayerType };
|
|
1953
1957
|
//# sourceMappingURL=draw.esm.js.map
|