@nmmty/lazycanvas 0.6.4 → 1.0.0-dev.10
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/ReadMe.md +1 -1
- package/dist/core/Interpolation.d.ts +30 -0
- package/dist/core/Interpolation.js +200 -0
- package/dist/core/Scene.d.ts +94 -0
- package/dist/core/Scene.js +157 -0
- package/dist/core/Signal.d.ts +133 -0
- package/dist/core/Signal.js +255 -0
- package/dist/core/SignalUtils.d.ts +133 -0
- package/dist/core/SignalUtils.js +333 -0
- package/dist/core/ThreadScheduler.d.ts +38 -0
- package/dist/core/ThreadScheduler.js +74 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +21 -0
- package/dist/helpers/Filters.js +1 -1
- package/dist/helpers/FontsList.js +18 -18
- package/dist/helpers/Utlis.d.ts +3 -3
- package/dist/helpers/Utlis.js +25 -36
- package/dist/helpers/index.d.ts +3 -3
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/jsx-runtime.d.ts +17 -0
- package/dist/jsx-runtime.js +111 -0
- package/dist/structures/LazyCanvas.d.ts +10 -48
- package/dist/structures/LazyCanvas.js +17 -78
- package/dist/structures/components/BaseLayer.d.ts +78 -32
- package/dist/structures/components/BaseLayer.js +106 -37
- package/dist/structures/components/BezierLayer.d.ts +27 -40
- package/dist/structures/components/BezierLayer.js +90 -55
- package/dist/structures/components/{Group.d.ts → Div.d.ts} +41 -22
- package/dist/structures/components/Div.js +202 -0
- package/dist/structures/components/ImageLayer.d.ts +2 -2
- package/dist/structures/components/ImageLayer.js +29 -30
- package/dist/structures/components/LineLayer.d.ts +20 -38
- package/dist/structures/components/LineLayer.js +45 -47
- package/dist/structures/components/MorphLayer.d.ts +5 -34
- package/dist/structures/components/MorphLayer.js +38 -52
- package/dist/structures/components/Path2DLayer.d.ts +7 -35
- package/dist/structures/components/Path2DLayer.js +32 -41
- package/dist/structures/components/PolygonLayer.d.ts +95 -0
- package/dist/structures/components/PolygonLayer.js +203 -0
- package/dist/structures/components/QuadraticLayer.d.ts +36 -45
- package/dist/structures/components/QuadraticLayer.js +90 -54
- package/dist/structures/components/TextLayer.d.ts +17 -46
- package/dist/structures/components/TextLayer.js +94 -77
- package/dist/structures/components/index.d.ts +10 -10
- package/dist/structures/components/index.js +2 -2
- package/dist/structures/helpers/Exporter.d.ts +13 -4
- package/dist/structures/helpers/Exporter.js +82 -46
- package/dist/structures/helpers/Font.js +1 -17
- package/dist/structures/helpers/Gradient.js +35 -49
- package/dist/structures/helpers/Link.js +2 -14
- package/dist/structures/helpers/Pattern.js +10 -18
- package/dist/structures/helpers/index.d.ts +7 -7
- package/dist/structures/helpers/readers/JSONReader.d.ts +4 -4
- package/dist/structures/helpers/readers/JSONReader.js +46 -48
- package/dist/structures/helpers/readers/YAMLReader.js +11 -11
- package/dist/structures/managers/FontsManager.js +9 -18
- package/dist/structures/managers/LayersManager.d.ts +18 -28
- package/dist/structures/managers/LayersManager.js +14 -36
- package/dist/structures/managers/LayoutManager.d.ts +23 -0
- package/dist/structures/managers/LayoutManager.js +409 -0
- package/dist/structures/managers/index.d.ts +3 -5
- package/dist/structures/managers/index.js +1 -3
- package/dist/structures/managers/{RenderManager.d.ts → piplines/ClassicRenderPipeline.d.ts} +4 -30
- package/dist/structures/managers/piplines/ClassicRenderPipeline.js +90 -0
- package/dist/structures/managers/piplines/ModernRenderPipeline.d.ts +44 -0
- package/dist/structures/managers/piplines/ModernRenderPipeline.js +123 -0
- package/dist/structures/managers/piplines/index.d.ts +24 -0
- package/dist/structures/managers/piplines/index.js +18 -0
- package/dist/types/enum.d.ts +4 -3
- package/dist/types/enum.js +3 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +257 -105
- package/dist/utils/APNGEncoder.d.ts +67 -0
- package/dist/utils/APNGEncoder.js +205 -0
- package/dist/utils/DrawUtils.d.ts +9 -0
- package/dist/utils/DrawUtils.js +42 -0
- package/dist/utils/LazyUtil.js +1 -2
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +20 -0
- package/dist/utils/utils.d.ts +5 -9
- package/dist/utils/utils.js +154 -78
- package/package.json +61 -59
- package/dist/structures/components/ClearLayer.d.ts +0 -147
- package/dist/structures/components/ClearLayer.js +0 -158
- package/dist/structures/components/Group.js +0 -153
- package/dist/structures/managers/AnimationManager.d.ts +0 -120
- package/dist/structures/managers/AnimationManager.js +0 -99
- package/dist/structures/managers/PluginManager.d.ts +0 -230
- package/dist/structures/managers/PluginManager.js +0 -182
- package/dist/structures/managers/RenderManager.js +0 -183
|
@@ -3,19 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.QuadraticLayer = void 0;
|
|
4
4
|
const BaseLayer_1 = require("./BaseLayer");
|
|
5
5
|
const types_1 = require("../../types");
|
|
6
|
-
const utils_1 = require("../../utils
|
|
7
|
-
const LazyUtil_1 = require("../../utils/LazyUtil");
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
8
7
|
/**
|
|
9
|
-
* Class representing a Quadratic
|
|
8
|
+
* Class representing a Quadratic layer, extending the BaseLayer class.
|
|
10
9
|
*/
|
|
11
10
|
class QuadraticLayer extends BaseLayer_1.BaseLayer {
|
|
12
|
-
/**
|
|
13
|
-
* The properties of the Quadratic Layer.
|
|
14
|
-
*/
|
|
15
|
-
props;
|
|
16
11
|
/**
|
|
17
12
|
* Constructs a new QuadraticLayer instance.
|
|
18
|
-
* @param {IQuadraticLayerProps} [props] - The properties of the Quadratic
|
|
13
|
+
* @param {IQuadraticLayerProps} [props] - The properties of the Quadratic layer.
|
|
19
14
|
* @param {IBaseLayerMisc} [misc] - Miscellaneous options for the layer.
|
|
20
15
|
*/
|
|
21
16
|
constructor(props, misc) {
|
|
@@ -34,13 +29,15 @@ class QuadraticLayer extends BaseLayer_1.BaseLayer {
|
|
|
34
29
|
return this;
|
|
35
30
|
}
|
|
36
31
|
/**
|
|
37
|
-
* Sets the
|
|
32
|
+
* Sets the position of the quadratic layer.
|
|
38
33
|
* @param {ScaleType} [x] - The x-coordinate of the end point.
|
|
39
34
|
* @param {ScaleType} [y] - The y-coordinate of the end point.
|
|
35
|
+
* @param {ScaleType} [endX] - The x-coordinate of the end point.
|
|
36
|
+
* @param {ScaleType} [endY] - The y-coordinate of the end point.
|
|
40
37
|
* @returns {this} The current instance for chaining.
|
|
41
38
|
*/
|
|
42
|
-
|
|
43
|
-
this.props.
|
|
39
|
+
setPosition(x, y, endX, endY) {
|
|
40
|
+
this.props.position = { x, y, endX: endX || 0, endY: endY || 0 };
|
|
44
41
|
return this;
|
|
45
42
|
}
|
|
46
43
|
/**
|
|
@@ -51,10 +48,10 @@ class QuadraticLayer extends BaseLayer_1.BaseLayer {
|
|
|
51
48
|
*/
|
|
52
49
|
setColor(color) {
|
|
53
50
|
if (!color)
|
|
54
|
-
throw new
|
|
51
|
+
throw new utils_1.LazyError("The color of the layer must be provided");
|
|
55
52
|
if (!(0, utils_1.isColor)(color))
|
|
56
|
-
throw new
|
|
57
|
-
this.props.
|
|
53
|
+
throw new utils_1.LazyError("The color of the layer must be a valid color");
|
|
54
|
+
this.props.color = color;
|
|
58
55
|
return this;
|
|
59
56
|
}
|
|
60
57
|
/**
|
|
@@ -70,8 +67,8 @@ class QuadraticLayer extends BaseLayer_1.BaseLayer {
|
|
|
70
67
|
setStroke(width, cap, join, dash, dashOffset, miterLimit) {
|
|
71
68
|
this.props.stroke = {
|
|
72
69
|
width,
|
|
73
|
-
cap: cap ||
|
|
74
|
-
join: join ||
|
|
70
|
+
cap: cap || "butt",
|
|
71
|
+
join: join || "miter",
|
|
75
72
|
dash: dash || [],
|
|
76
73
|
dashOffset: dashOffset || 0,
|
|
77
74
|
miterLimit: miterLimit || 10,
|
|
@@ -82,97 +79,136 @@ class QuadraticLayer extends BaseLayer_1.BaseLayer {
|
|
|
82
79
|
* Calculates the bounding box of the quadratic curve.
|
|
83
80
|
* @param {SKRSContext2D} [ctx] - The canvas rendering context.
|
|
84
81
|
* @param {Canvas | SvgCanvas} [canvas] - The canvas instance.
|
|
85
|
-
* @param {LayersManager} [manager] - The
|
|
82
|
+
* @param {LayersManager} [manager] - The layer's manager.
|
|
86
83
|
* @returns {Object} The bounding box details including max, min, center, width, and height.
|
|
87
84
|
*/
|
|
88
85
|
getBoundingBox(ctx, canvas, manager) {
|
|
89
86
|
const parcer = (0, utils_1.parser)(ctx, canvas, manager);
|
|
90
87
|
const { xs, ys, cx, cy, xe, ye } = parcer.parseBatch({
|
|
91
|
-
xs: { v: this.props.x },
|
|
92
|
-
ys: { v: this.props.y, options:
|
|
88
|
+
xs: { v: this.props.position.x },
|
|
89
|
+
ys: { v: this.props.position.y, options: utils_1.defaultArg.vl(true) },
|
|
93
90
|
cx: { v: this.props.controlPoints[0].x },
|
|
94
|
-
cy: { v: this.props.controlPoints[0].y, options:
|
|
95
|
-
xe: { v: this.props.
|
|
96
|
-
ye: { v: this.props.
|
|
91
|
+
cy: { v: this.props.controlPoints[0].y, options: utils_1.defaultArg.vl(true) },
|
|
92
|
+
xe: { v: this.props.position.endX },
|
|
93
|
+
ye: { v: this.props.position.endY, options: utils_1.defaultArg.vl(true) },
|
|
97
94
|
});
|
|
98
|
-
const { max, min, center, width, height } = (0, utils_1.getBoundingBoxBezier)([
|
|
95
|
+
const { max, min, center, width, height } = (0, utils_1.getBoundingBoxBezier)([
|
|
96
|
+
{ x: xs, y: ys },
|
|
97
|
+
{ x: cx, y: cy },
|
|
98
|
+
{ x: xe, y: ye },
|
|
99
|
+
]);
|
|
99
100
|
return { max, min, center, width, height };
|
|
100
101
|
}
|
|
101
102
|
/**
|
|
102
103
|
* Draws the quadratic curve on the canvas.
|
|
103
104
|
* @param {SKRSContext2D} [ctx] - The canvas rendering context.
|
|
104
105
|
* @param {Canvas | SvgCanvas} [canvas] - The canvas instance.
|
|
105
|
-
* @param {LayersManager} [manager] - The
|
|
106
|
+
* @param {LayersManager} [manager] - The layer's manager.
|
|
106
107
|
* @param {boolean} [debug] - Whether to enable debug logging.
|
|
107
108
|
*/
|
|
108
109
|
async draw(ctx, canvas, manager, debug) {
|
|
109
110
|
const parcer = (0, utils_1.parser)(ctx, canvas, manager);
|
|
110
111
|
const { xs, ys, cx, cy, xe, ye } = parcer.parseBatch({
|
|
111
|
-
xs: { v: this.props.x },
|
|
112
|
-
ys: { v: this.props.y, options:
|
|
112
|
+
xs: { v: this.props.position.x },
|
|
113
|
+
ys: { v: this.props.position.y, options: utils_1.defaultArg.vl(true) },
|
|
113
114
|
cx: { v: this.props.controlPoints[0].x },
|
|
114
|
-
cy: { v: this.props.controlPoints[0].y, options:
|
|
115
|
-
xe: { v: this.props.
|
|
116
|
-
ye: { v: this.props.
|
|
115
|
+
cy: { v: this.props.controlPoints[0].y, options: utils_1.defaultArg.vl(true) },
|
|
116
|
+
xe: { v: this.props.position.endX },
|
|
117
|
+
ye: { v: this.props.position.endY, options: utils_1.defaultArg.vl(true) },
|
|
118
|
+
});
|
|
119
|
+
const { max, min, center, width, height } = (0, utils_1.getBoundingBoxBezier)([
|
|
120
|
+
{ x: xs, y: ys },
|
|
121
|
+
{ x: cx, y: cy },
|
|
122
|
+
{ x: xe, y: ye },
|
|
123
|
+
]);
|
|
124
|
+
let fillStyle = await (0, utils_1.parseFillStyle)(ctx, this.props.color, {
|
|
125
|
+
debug,
|
|
126
|
+
layer: { width, height, x: min.x, y: min.y, align: "none" },
|
|
127
|
+
manager,
|
|
117
128
|
});
|
|
118
|
-
const { max, min, center, width, height } = (0, utils_1.getBoundingBoxBezier)([{ x: xs, y: ys }, { x: cx, y: cy }, { x: xe, y: ye }]);
|
|
119
|
-
let fillStyle = await (0, utils_1.parseFillStyle)(ctx, this.props.fillStyle, { debug, layer: { width, height, x: min.x, y: min.y, align: 'none' }, manager });
|
|
120
129
|
if (debug)
|
|
121
|
-
|
|
130
|
+
utils_1.LazyLog.log("none", `BezierLayer:`, {
|
|
131
|
+
xs,
|
|
132
|
+
ys,
|
|
133
|
+
cx,
|
|
134
|
+
cy,
|
|
135
|
+
xe,
|
|
136
|
+
ye,
|
|
137
|
+
max,
|
|
138
|
+
min,
|
|
139
|
+
center,
|
|
140
|
+
width,
|
|
141
|
+
height,
|
|
142
|
+
fillStyle,
|
|
143
|
+
});
|
|
122
144
|
ctx.save();
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
145
|
+
if (this.props.transform) {
|
|
146
|
+
(0, utils_1.transform)(ctx, this.props.transform, {
|
|
147
|
+
x: center.x,
|
|
148
|
+
y: center.y,
|
|
149
|
+
width,
|
|
150
|
+
height,
|
|
151
|
+
type: this.type,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
utils_1.DrawUtils.drawShadow(ctx, this.props.shadow);
|
|
155
|
+
utils_1.DrawUtils.opacity(ctx, this.props.opacity);
|
|
156
|
+
utils_1.DrawUtils.filters(ctx, this.props.filter);
|
|
157
|
+
utils_1.DrawUtils.fillStyle(ctx, fillStyle, this.props.stroke);
|
|
127
158
|
ctx.beginPath();
|
|
128
159
|
ctx.moveTo(xs, ys);
|
|
129
|
-
ctx.strokeStyle = fillStyle;
|
|
130
|
-
ctx.lineWidth = this.props.stroke?.width || 1;
|
|
131
|
-
ctx.lineCap = this.props.stroke?.cap || 'butt';
|
|
132
|
-
ctx.lineJoin = this.props.stroke?.join || 'miter';
|
|
133
|
-
ctx.miterLimit = this.props.stroke?.miterLimit || 10;
|
|
134
|
-
ctx.lineDashOffset = this.props.stroke?.dashOffset || 0;
|
|
135
|
-
ctx.setLineDash(this.props.stroke?.dash || []);
|
|
136
160
|
ctx.quadraticCurveTo(cx, cy, xe, ye);
|
|
137
161
|
ctx.stroke();
|
|
138
162
|
ctx.closePath();
|
|
139
163
|
ctx.restore();
|
|
140
164
|
}
|
|
141
165
|
/**
|
|
142
|
-
* Converts the Quadratic
|
|
143
|
-
* @returns {IQuadraticLayer} The JSON representation of the Quadratic
|
|
166
|
+
* Converts the Quadratic layer to a JSON representation.
|
|
167
|
+
* @returns {IQuadraticLayer} The JSON representation of the Quadratic layer.
|
|
144
168
|
*/
|
|
145
169
|
toJSON() {
|
|
146
170
|
let data = super.toJSON();
|
|
147
171
|
let copy = { ...this.props };
|
|
148
|
-
for (const key of [
|
|
149
|
-
|
|
172
|
+
for (const key of [
|
|
173
|
+
"x",
|
|
174
|
+
"y",
|
|
175
|
+
"endPoint.x",
|
|
176
|
+
"endPoint.y",
|
|
177
|
+
"controlPoint.x",
|
|
178
|
+
"controlPoint.y",
|
|
179
|
+
"fillStyle",
|
|
180
|
+
]) {
|
|
181
|
+
if (copy[key] && typeof copy[key] === "object" && "toJSON" in copy[key]) {
|
|
150
182
|
copy[key] = copy[key].toJSON();
|
|
151
183
|
}
|
|
152
184
|
}
|
|
153
185
|
return { ...data, props: copy };
|
|
154
186
|
}
|
|
155
187
|
/**
|
|
156
|
-
* Validates the properties of the Quadratic
|
|
188
|
+
* Validates the properties of the Quadratic layer.
|
|
157
189
|
* @param {IQuadraticLayerProps} [data] - The properties to validate.
|
|
158
190
|
* @returns {IQuadraticLayerProps} The validated properties.
|
|
159
191
|
*/
|
|
160
192
|
validateProps(data) {
|
|
161
193
|
return {
|
|
162
194
|
...super.validateProps(data),
|
|
163
|
-
|
|
164
|
-
|
|
195
|
+
position: {
|
|
196
|
+
x: data.position?.x || 0,
|
|
197
|
+
y: data.position?.y || 0,
|
|
198
|
+
endX: data.position?.endX || 0,
|
|
199
|
+
endY: data.position?.endY || 0,
|
|
200
|
+
},
|
|
201
|
+
color: data.color || "#000000",
|
|
165
202
|
centring: data.centring || types_1.Centring.None,
|
|
166
203
|
controlPoints: data.controlPoints || [{ x: 0, y: 0 }],
|
|
167
|
-
endPoint: data.endPoint || { x: 0, y: 0 },
|
|
168
204
|
stroke: {
|
|
169
205
|
width: data.stroke?.width || 1,
|
|
170
|
-
cap: data.stroke?.cap ||
|
|
171
|
-
join: data.stroke?.join ||
|
|
206
|
+
cap: data.stroke?.cap || "butt",
|
|
207
|
+
join: data.stroke?.join || "miter",
|
|
172
208
|
dashOffset: data.stroke?.dashOffset || 0,
|
|
173
209
|
dash: data.stroke?.dash || [],
|
|
174
210
|
miterLimit: data.stroke?.miterLimit || 10,
|
|
175
|
-
}
|
|
211
|
+
},
|
|
176
212
|
};
|
|
177
213
|
}
|
|
178
214
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseLayer, IBaseLayer, IBaseLayerMisc, IBaseLayerProps } from "./BaseLayer";
|
|
2
|
-
import { AnyTextAlign, AnyTextBaseline, AnyTextDirection, AnyWeight, ColorType, LayerType, LineCap, LineJoin, ScaleType, SubStringColor } from "../../types";
|
|
2
|
+
import { AnyTextAlign, AnyTextBaseline, AnyTextDirection, AnyWeight, ColorType, LayerType, LineCap, LineJoin, ScaleType, StrokeOptions, SubStringColor } from "../../types";
|
|
3
3
|
import { Canvas, SKRSContext2D, SvgCanvas } from "@napi-rs/canvas";
|
|
4
4
|
import { LayersManager } from "../managers";
|
|
5
5
|
/**
|
|
6
|
-
* Interface representing a Text
|
|
6
|
+
* Interface representing a Text layer.
|
|
7
7
|
*/
|
|
8
8
|
export interface ITextLayer extends IBaseLayer {
|
|
9
9
|
/**
|
|
@@ -11,26 +11,22 @@ export interface ITextLayer extends IBaseLayer {
|
|
|
11
11
|
*/
|
|
12
12
|
type: LayerType.Text;
|
|
13
13
|
/**
|
|
14
|
-
* The properties specific to the Text
|
|
14
|
+
* The properties specific to the Text layer.
|
|
15
15
|
*/
|
|
16
16
|
props: ITextLayerProps;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Interface representing the properties of a Text
|
|
19
|
+
* Interface representing the properties of a Text layer.
|
|
20
20
|
*/
|
|
21
21
|
export interface ITextLayerProps extends IBaseLayerProps {
|
|
22
22
|
/**
|
|
23
23
|
* The text content of the layer.
|
|
24
24
|
*/
|
|
25
25
|
text: string;
|
|
26
|
-
/**
|
|
27
|
-
* Whether the layer is filled.
|
|
28
|
-
*/
|
|
29
|
-
filled: boolean;
|
|
30
26
|
/**
|
|
31
27
|
* The fill style (color or pattern) of the layer.
|
|
32
28
|
*/
|
|
33
|
-
|
|
29
|
+
color: ColorType;
|
|
34
30
|
/**
|
|
35
31
|
* Array of substring color configurations for partial text coloring.
|
|
36
32
|
*/
|
|
@@ -55,7 +51,7 @@ export interface ITextLayerProps extends IBaseLayerProps {
|
|
|
55
51
|
/**
|
|
56
52
|
* Configuration for multiline text.
|
|
57
53
|
*/
|
|
58
|
-
multiline
|
|
54
|
+
multiline?: {
|
|
59
55
|
/**
|
|
60
56
|
* Whether multiline is enabled.
|
|
61
57
|
*/
|
|
@@ -66,15 +62,15 @@ export interface ITextLayerProps extends IBaseLayerProps {
|
|
|
66
62
|
spacing?: number;
|
|
67
63
|
};
|
|
68
64
|
/**
|
|
69
|
-
* The size of the
|
|
65
|
+
* The size of the Text layer, including width and height.
|
|
70
66
|
*/
|
|
71
|
-
size
|
|
67
|
+
size?: {
|
|
72
68
|
/**
|
|
73
|
-
* The width of the
|
|
69
|
+
* The width of the Text layer.
|
|
74
70
|
*/
|
|
75
71
|
width: ScaleType;
|
|
76
72
|
/**
|
|
77
|
-
* The height of the
|
|
73
|
+
* The height of the Text layer.
|
|
78
74
|
*/
|
|
79
75
|
height: ScaleType;
|
|
80
76
|
};
|
|
@@ -101,35 +97,10 @@ export interface ITextLayerProps extends IBaseLayerProps {
|
|
|
101
97
|
/**
|
|
102
98
|
* The stroke properties of the text.
|
|
103
99
|
*/
|
|
104
|
-
stroke?:
|
|
105
|
-
/**
|
|
106
|
-
* The width of the stroke.
|
|
107
|
-
*/
|
|
108
|
-
width: number;
|
|
109
|
-
/**
|
|
110
|
-
* The cap style of the stroke.
|
|
111
|
-
*/
|
|
112
|
-
cap: CanvasLineCap;
|
|
113
|
-
/**
|
|
114
|
-
* The join style of the stroke.
|
|
115
|
-
*/
|
|
116
|
-
join: CanvasLineJoin;
|
|
117
|
-
/**
|
|
118
|
-
* The dash offset of the stroke.
|
|
119
|
-
*/
|
|
120
|
-
dashOffset: number;
|
|
121
|
-
/**
|
|
122
|
-
* The dash pattern of the stroke.
|
|
123
|
-
*/
|
|
124
|
-
dash: number[];
|
|
125
|
-
/**
|
|
126
|
-
* The miter limit of the stroke.
|
|
127
|
-
*/
|
|
128
|
-
miterLimit: number;
|
|
129
|
-
};
|
|
100
|
+
stroke?: StrokeOptions;
|
|
130
101
|
}
|
|
131
102
|
/**
|
|
132
|
-
* Class representing a Text
|
|
103
|
+
* Class representing a Text layer, extending the BaseLayer class.
|
|
133
104
|
*/
|
|
134
105
|
export declare class TextLayer extends BaseLayer<ITextLayerProps> {
|
|
135
106
|
/**
|
|
@@ -138,7 +109,7 @@ export declare class TextLayer extends BaseLayer<ITextLayerProps> {
|
|
|
138
109
|
props: ITextLayerProps;
|
|
139
110
|
/**
|
|
140
111
|
* Constructs a new TextLayer instance.
|
|
141
|
-
* @param {ITextLayerProps} [props] - The properties of the Text
|
|
112
|
+
* @param {ITextLayerProps} [props] - The properties of the Text layer.
|
|
142
113
|
* @param {IBaseLayerMisc} [misc] - Miscellaneous options for the layer.
|
|
143
114
|
*/
|
|
144
115
|
constructor(props?: ITextLayerProps, misc?: IBaseLayerMisc);
|
|
@@ -232,7 +203,7 @@ export declare class TextLayer extends BaseLayer<ITextLayerProps> {
|
|
|
232
203
|
* Draws the text layer on the canvas.
|
|
233
204
|
* @param {SKRSContext2D} [ctx] - The canvas rendering context.
|
|
234
205
|
* @param {Canvas | SvgCanvas} [canvas] - The canvas instance.
|
|
235
|
-
* @param {LayersManager} [manager] - The
|
|
206
|
+
* @param {LayersManager} [manager] - The layer's manager.
|
|
236
207
|
* @param {boolean} [debug] - Whether to enable debug logging.
|
|
237
208
|
*/
|
|
238
209
|
draw(ctx: SKRSContext2D, canvas: Canvas | SvgCanvas, manager: LayersManager, debug: boolean): Promise<void>;
|
|
@@ -249,12 +220,12 @@ export declare class TextLayer extends BaseLayer<ITextLayerProps> {
|
|
|
249
220
|
*/
|
|
250
221
|
private drawText;
|
|
251
222
|
/**
|
|
252
|
-
* Converts the Text
|
|
253
|
-
* @returns {ITextLayer} The JSON representation of the Text
|
|
223
|
+
* Converts the Text layer to a JSON representation.
|
|
224
|
+
* @returns {ITextLayer} The JSON representation of the Text layer.
|
|
254
225
|
*/
|
|
255
226
|
toJSON(): ITextLayer;
|
|
256
227
|
/**
|
|
257
|
-
* Validates the properties of the Text
|
|
228
|
+
* Validates the properties of the Text layer.
|
|
258
229
|
* @param {ITextLayerProps} [data] - The properties to validate.
|
|
259
230
|
* @returns {ITextLayerProps} The validated properties.
|
|
260
231
|
*/
|