microboard-temp 0.4.95 → 0.4.96
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/cjs/browser.js
CHANGED
|
@@ -47863,14 +47863,14 @@ class Card extends BaseItem {
|
|
|
47863
47863
|
this.imageToRender = this.face;
|
|
47864
47864
|
}
|
|
47865
47865
|
}
|
|
47866
|
-
render(context, left) {
|
|
47866
|
+
render(context, left, top) {
|
|
47867
47867
|
if (this.transformationRenderBlock) {
|
|
47868
47868
|
return;
|
|
47869
47869
|
}
|
|
47870
47870
|
const ctx = context.ctx;
|
|
47871
47871
|
if (this.imageToRender && this.imageToRender.complete) {
|
|
47872
47872
|
ctx.save();
|
|
47873
|
-
ctx.drawImage(this.imageToRender, left ? left : this.left, this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
47873
|
+
ctx.drawImage(this.imageToRender, typeof left === "number" ? left : this.left, typeof top === "number" ? top : this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
47874
47874
|
ctx.restore();
|
|
47875
47875
|
}
|
|
47876
47876
|
}
|
|
@@ -48070,14 +48070,14 @@ class Deck extends BaseItem {
|
|
|
48070
48070
|
return;
|
|
48071
48071
|
}
|
|
48072
48072
|
const tempCanvas = conf.documentFactory.createElement("canvas");
|
|
48073
|
-
tempCanvas.width =
|
|
48074
|
-
tempCanvas.height =
|
|
48073
|
+
tempCanvas.width = width2;
|
|
48074
|
+
tempCanvas.height = height3;
|
|
48075
48075
|
const tempCtx = tempCanvas.getContext("2d");
|
|
48076
48076
|
if (!tempCtx)
|
|
48077
48077
|
return;
|
|
48078
48078
|
const tempContext = { ...context, ctx: tempCtx };
|
|
48079
48079
|
this.index?.list().forEach((item, index2) => {
|
|
48080
|
-
item.render(tempContext, index2 * 2);
|
|
48080
|
+
item.render(tempContext, index2 * 2, 0);
|
|
48081
48081
|
});
|
|
48082
48082
|
this.cachedCanvas = tempCanvas;
|
|
48083
48083
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -47863,14 +47863,14 @@ class Card extends BaseItem {
|
|
|
47863
47863
|
this.imageToRender = this.face;
|
|
47864
47864
|
}
|
|
47865
47865
|
}
|
|
47866
|
-
render(context, left) {
|
|
47866
|
+
render(context, left, top) {
|
|
47867
47867
|
if (this.transformationRenderBlock) {
|
|
47868
47868
|
return;
|
|
47869
47869
|
}
|
|
47870
47870
|
const ctx = context.ctx;
|
|
47871
47871
|
if (this.imageToRender && this.imageToRender.complete) {
|
|
47872
47872
|
ctx.save();
|
|
47873
|
-
ctx.drawImage(this.imageToRender, left ? left : this.left, this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
47873
|
+
ctx.drawImage(this.imageToRender, typeof left === "number" ? left : this.left, typeof top === "number" ? top : this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
47874
47874
|
ctx.restore();
|
|
47875
47875
|
}
|
|
47876
47876
|
}
|
|
@@ -48070,14 +48070,14 @@ class Deck extends BaseItem {
|
|
|
48070
48070
|
return;
|
|
48071
48071
|
}
|
|
48072
48072
|
const tempCanvas = conf.documentFactory.createElement("canvas");
|
|
48073
|
-
tempCanvas.width =
|
|
48074
|
-
tempCanvas.height =
|
|
48073
|
+
tempCanvas.width = width2;
|
|
48074
|
+
tempCanvas.height = height3;
|
|
48075
48075
|
const tempCtx = tempCanvas.getContext("2d");
|
|
48076
48076
|
if (!tempCtx)
|
|
48077
48077
|
return;
|
|
48078
48078
|
const tempContext = { ...context, ctx: tempCtx };
|
|
48079
48079
|
this.index?.list().forEach((item, index2) => {
|
|
48080
|
-
item.render(tempContext, index2 * 2);
|
|
48080
|
+
item.render(tempContext, index2 * 2, 0);
|
|
48081
48081
|
});
|
|
48082
48082
|
this.cachedCanvas = tempCanvas;
|
|
48083
48083
|
}
|
package/dist/cjs/node.js
CHANGED
|
@@ -50336,14 +50336,14 @@ class Card extends BaseItem {
|
|
|
50336
50336
|
this.imageToRender = this.face;
|
|
50337
50337
|
}
|
|
50338
50338
|
}
|
|
50339
|
-
render(context, left) {
|
|
50339
|
+
render(context, left, top) {
|
|
50340
50340
|
if (this.transformationRenderBlock) {
|
|
50341
50341
|
return;
|
|
50342
50342
|
}
|
|
50343
50343
|
const ctx = context.ctx;
|
|
50344
50344
|
if (this.imageToRender && this.imageToRender.complete) {
|
|
50345
50345
|
ctx.save();
|
|
50346
|
-
ctx.drawImage(this.imageToRender, left ? left : this.left, this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
50346
|
+
ctx.drawImage(this.imageToRender, typeof left === "number" ? left : this.left, typeof top === "number" ? top : this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
50347
50347
|
ctx.restore();
|
|
50348
50348
|
}
|
|
50349
50349
|
}
|
|
@@ -50543,14 +50543,14 @@ class Deck extends BaseItem {
|
|
|
50543
50543
|
return;
|
|
50544
50544
|
}
|
|
50545
50545
|
const tempCanvas = conf.documentFactory.createElement("canvas");
|
|
50546
|
-
tempCanvas.width =
|
|
50547
|
-
tempCanvas.height =
|
|
50546
|
+
tempCanvas.width = width2;
|
|
50547
|
+
tempCanvas.height = height3;
|
|
50548
50548
|
const tempCtx = tempCanvas.getContext("2d");
|
|
50549
50549
|
if (!tempCtx)
|
|
50550
50550
|
return;
|
|
50551
50551
|
const tempContext = { ...context, ctx: tempCtx };
|
|
50552
50552
|
this.index?.list().forEach((item, index2) => {
|
|
50553
|
-
item.render(tempContext, index2 * 2);
|
|
50553
|
+
item.render(tempContext, index2 * 2, 0);
|
|
50554
50554
|
});
|
|
50555
50555
|
this.cachedCanvas = tempCanvas;
|
|
50556
50556
|
}
|
package/dist/esm/browser.js
CHANGED
|
@@ -47712,14 +47712,14 @@ class Card extends BaseItem {
|
|
|
47712
47712
|
this.imageToRender = this.face;
|
|
47713
47713
|
}
|
|
47714
47714
|
}
|
|
47715
|
-
render(context, left) {
|
|
47715
|
+
render(context, left, top) {
|
|
47716
47716
|
if (this.transformationRenderBlock) {
|
|
47717
47717
|
return;
|
|
47718
47718
|
}
|
|
47719
47719
|
const ctx = context.ctx;
|
|
47720
47720
|
if (this.imageToRender && this.imageToRender.complete) {
|
|
47721
47721
|
ctx.save();
|
|
47722
|
-
ctx.drawImage(this.imageToRender, left ? left : this.left, this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
47722
|
+
ctx.drawImage(this.imageToRender, typeof left === "number" ? left : this.left, typeof top === "number" ? top : this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
47723
47723
|
ctx.restore();
|
|
47724
47724
|
}
|
|
47725
47725
|
}
|
|
@@ -47919,14 +47919,14 @@ class Deck extends BaseItem {
|
|
|
47919
47919
|
return;
|
|
47920
47920
|
}
|
|
47921
47921
|
const tempCanvas = conf.documentFactory.createElement("canvas");
|
|
47922
|
-
tempCanvas.width =
|
|
47923
|
-
tempCanvas.height =
|
|
47922
|
+
tempCanvas.width = width2;
|
|
47923
|
+
tempCanvas.height = height3;
|
|
47924
47924
|
const tempCtx = tempCanvas.getContext("2d");
|
|
47925
47925
|
if (!tempCtx)
|
|
47926
47926
|
return;
|
|
47927
47927
|
const tempContext = { ...context, ctx: tempCtx };
|
|
47928
47928
|
this.index?.list().forEach((item, index2) => {
|
|
47929
|
-
item.render(tempContext, index2 * 2);
|
|
47929
|
+
item.render(tempContext, index2 * 2, 0);
|
|
47930
47930
|
});
|
|
47931
47931
|
this.cachedCanvas = tempCanvas;
|
|
47932
47932
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -47705,14 +47705,14 @@ class Card extends BaseItem {
|
|
|
47705
47705
|
this.imageToRender = this.face;
|
|
47706
47706
|
}
|
|
47707
47707
|
}
|
|
47708
|
-
render(context, left) {
|
|
47708
|
+
render(context, left, top) {
|
|
47709
47709
|
if (this.transformationRenderBlock) {
|
|
47710
47710
|
return;
|
|
47711
47711
|
}
|
|
47712
47712
|
const ctx = context.ctx;
|
|
47713
47713
|
if (this.imageToRender && this.imageToRender.complete) {
|
|
47714
47714
|
ctx.save();
|
|
47715
|
-
ctx.drawImage(this.imageToRender, left ? left : this.left, this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
47715
|
+
ctx.drawImage(this.imageToRender, typeof left === "number" ? left : this.left, typeof top === "number" ? top : this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
47716
47716
|
ctx.restore();
|
|
47717
47717
|
}
|
|
47718
47718
|
}
|
|
@@ -47912,14 +47912,14 @@ class Deck extends BaseItem {
|
|
|
47912
47912
|
return;
|
|
47913
47913
|
}
|
|
47914
47914
|
const tempCanvas = conf.documentFactory.createElement("canvas");
|
|
47915
|
-
tempCanvas.width =
|
|
47916
|
-
tempCanvas.height =
|
|
47915
|
+
tempCanvas.width = width2;
|
|
47916
|
+
tempCanvas.height = height3;
|
|
47917
47917
|
const tempCtx = tempCanvas.getContext("2d");
|
|
47918
47918
|
if (!tempCtx)
|
|
47919
47919
|
return;
|
|
47920
47920
|
const tempContext = { ...context, ctx: tempCtx };
|
|
47921
47921
|
this.index?.list().forEach((item, index2) => {
|
|
47922
|
-
item.render(tempContext, index2 * 2);
|
|
47922
|
+
item.render(tempContext, index2 * 2, 0);
|
|
47923
47923
|
});
|
|
47924
47924
|
this.cachedCanvas = tempCanvas;
|
|
47925
47925
|
}
|
package/dist/esm/node.js
CHANGED
|
@@ -50173,14 +50173,14 @@ class Card extends BaseItem {
|
|
|
50173
50173
|
this.imageToRender = this.face;
|
|
50174
50174
|
}
|
|
50175
50175
|
}
|
|
50176
|
-
render(context, left) {
|
|
50176
|
+
render(context, left, top) {
|
|
50177
50177
|
if (this.transformationRenderBlock) {
|
|
50178
50178
|
return;
|
|
50179
50179
|
}
|
|
50180
50180
|
const ctx = context.ctx;
|
|
50181
50181
|
if (this.imageToRender && this.imageToRender.complete) {
|
|
50182
50182
|
ctx.save();
|
|
50183
|
-
ctx.drawImage(this.imageToRender, left ? left : this.left, this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
50183
|
+
ctx.drawImage(this.imageToRender, typeof left === "number" ? left : this.left, typeof top === "number" ? top : this.top, CARD_DIMENSIONS.width, CARD_DIMENSIONS.height);
|
|
50184
50184
|
ctx.restore();
|
|
50185
50185
|
}
|
|
50186
50186
|
}
|
|
@@ -50380,14 +50380,14 @@ class Deck extends BaseItem {
|
|
|
50380
50380
|
return;
|
|
50381
50381
|
}
|
|
50382
50382
|
const tempCanvas = conf.documentFactory.createElement("canvas");
|
|
50383
|
-
tempCanvas.width =
|
|
50384
|
-
tempCanvas.height =
|
|
50383
|
+
tempCanvas.width = width2;
|
|
50384
|
+
tempCanvas.height = height3;
|
|
50385
50385
|
const tempCtx = tempCanvas.getContext("2d");
|
|
50386
50386
|
if (!tempCtx)
|
|
50387
50387
|
return;
|
|
50388
50388
|
const tempContext = { ...context, ctx: tempCtx };
|
|
50389
50389
|
this.index?.list().forEach((item, index2) => {
|
|
50390
|
-
item.render(tempContext, index2 * 2);
|
|
50390
|
+
item.render(tempContext, index2 * 2, 0);
|
|
50391
50391
|
});
|
|
50392
50392
|
this.cachedCanvas = tempCanvas;
|
|
50393
50393
|
}
|
|
@@ -26,7 +26,7 @@ export declare class Card extends BaseItem {
|
|
|
26
26
|
});
|
|
27
27
|
createImages(): void;
|
|
28
28
|
updateImageToRender(): void;
|
|
29
|
-
render(context: DrawingContext, left?: number): void;
|
|
29
|
+
render(context: DrawingContext, left?: number, top?: number): void;
|
|
30
30
|
updateMbr(): void;
|
|
31
31
|
getPath(): Path | Paths;
|
|
32
32
|
deserialize(data: SerializedItemData): this;
|