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