Skip to content

Commit

Permalink
Merge pull request #123 from VisActor/fix/canvas-size
Browse files Browse the repository at this point in the history
fix: fix canvas size while create by container
  • Loading branch information
neuqzxy authored Nov 28, 2024
2 parents 40963e6 + 7493148 commit bbe66c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vstory-core/src/core/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ export class StoryCanvas implements IStoryCanvas {

const {
canvas,
width = 500,
height = 500,
width,
height,
background = 'transparent',
layerBackground = 'transparent',
dpr = vglobal.devicePixelRatio,
scaleX = 1,
scaleY = 1
} = params;
this._container && this._initCanvasByContainer(width, height, dpr);
params.canvas && this._initCanvasByCanvas(canvas, width, height, dpr);
params.canvas && this._initCanvasByCanvas(canvas, width ?? 500, height ?? 500, dpr);

this._stage.background = background;
this._stage.defaultLayer.setAttributes({ background: layerBackground });
Expand Down

0 comments on commit bbe66c1

Please sign in to comment.