modern-canvas 0.4.47 → 0.4.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +29 -29
- package/dist/index.mjs +4 -4
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -9170,7 +9170,7 @@ class BaseElement2DOutline extends BaseElement2DFill {
|
|
|
9170
9170
|
draw() {
|
|
9171
9171
|
const ctx = this.parent.context;
|
|
9172
9172
|
const { textureTransform, disableWrapMode } = this._getDrawOptions();
|
|
9173
|
-
ctx.lineWidth = this.width;
|
|
9173
|
+
ctx.lineWidth = this.width || 1;
|
|
9174
9174
|
ctx.textureTransform = textureTransform;
|
|
9175
9175
|
ctx.strokeStyle = this._texture ?? this.color;
|
|
9176
9176
|
ctx.stroke({ disableWrapMode });
|
|
@@ -9270,7 +9270,7 @@ class BaseElement2DShape extends CoreObject {
|
|
|
9270
9270
|
super._updateProperty(key, value, oldValue, declaration);
|
|
9271
9271
|
switch (key) {
|
|
9272
9272
|
case "svg":
|
|
9273
|
-
case "
|
|
9273
|
+
case "paths":
|
|
9274
9274
|
case "viewBox":
|
|
9275
9275
|
this._updatePath2DSet();
|
|
9276
9276
|
this.parent.requestRedraw();
|
|
@@ -9285,7 +9285,7 @@ class BaseElement2DShape extends CoreObject {
|
|
|
9285
9285
|
viewBox = this._path2DSet.viewBox ?? this.viewBox;
|
|
9286
9286
|
} else {
|
|
9287
9287
|
viewBox = this.viewBox;
|
|
9288
|
-
this.
|
|
9288
|
+
this.paths?.forEach((path, i) => {
|
|
9289
9289
|
const { data, ...style } = path;
|
|
9290
9290
|
const path2D = new modernPath2d.Path2D();
|
|
9291
9291
|
path2D.style = style;
|
|
@@ -9333,7 +9333,7 @@ __decorateClass$p([
|
|
|
9333
9333
|
], BaseElement2DShape.prototype, "viewBox");
|
|
9334
9334
|
__decorateClass$p([
|
|
9335
9335
|
property({ default: () => [] })
|
|
9336
|
-
], BaseElement2DShape.prototype, "
|
|
9336
|
+
], BaseElement2DShape.prototype, "paths");
|
|
9337
9337
|
|
|
9338
9338
|
class BaseElement2DStyle extends Resource {
|
|
9339
9339
|
constructor(properties) {
|
package/dist/index.d.cts
CHANGED
|
@@ -1959,7 +1959,7 @@ declare class BaseElement2DShape extends CoreObject {
|
|
|
1959
1959
|
preset?: Required<NormalizedShape>['preset'];
|
|
1960
1960
|
svg?: Required<NormalizedShape>['svg'];
|
|
1961
1961
|
viewBox: Required<NormalizedShape>['viewBox'];
|
|
1962
|
-
|
|
1962
|
+
paths: Required<NormalizedShape>['paths'];
|
|
1963
1963
|
protected _path2DSet: Path2DSet;
|
|
1964
1964
|
constructor(parent: BaseElement2D);
|
|
1965
1965
|
setProperties(properties?: Shape): this;
|
package/dist/index.d.mts
CHANGED
|
@@ -1959,7 +1959,7 @@ declare class BaseElement2DShape extends CoreObject {
|
|
|
1959
1959
|
preset?: Required<NormalizedShape>['preset'];
|
|
1960
1960
|
svg?: Required<NormalizedShape>['svg'];
|
|
1961
1961
|
viewBox: Required<NormalizedShape>['viewBox'];
|
|
1962
|
-
|
|
1962
|
+
paths: Required<NormalizedShape>['paths'];
|
|
1963
1963
|
protected _path2DSet: Path2DSet;
|
|
1964
1964
|
constructor(parent: BaseElement2D);
|
|
1965
1965
|
setProperties(properties?: Shape): this;
|
package/dist/index.d.ts
CHANGED
|
@@ -1959,7 +1959,7 @@ declare class BaseElement2DShape extends CoreObject {
|
|
|
1959
1959
|
preset?: Required<NormalizedShape>['preset'];
|
|
1960
1960
|
svg?: Required<NormalizedShape>['svg'];
|
|
1961
1961
|
viewBox: Required<NormalizedShape>['viewBox'];
|
|
1962
|
-
|
|
1962
|
+
paths: Required<NormalizedShape>['paths'];
|
|
1963
1963
|
protected _path2DSet: Path2DSet;
|
|
1964
1964
|
constructor(parent: BaseElement2D);
|
|
1965
1965
|
setProperties(properties?: Shape): this;
|