Brooooooklyn / canvas

High performance skia binding to Node.js. Zero system dependencies and pure npm packages without any postinstall scripts nor node-gyp.
https://vercel.skia.rs
MIT License
1.78k stars 76 forks source link

Height setting doesn't work after creating an SvgCanvas #927

Closed deemaagog closed 2 weeks ago

deemaagog commented 2 weeks ago

It works for Canvas

const canvas = createCanvas(containerWidth, 0) 
canvas.height = 400 // fine, the height of rendered image is 400

But for SvgCanvas setter does not work

const canvas = createCanvas(containerWidth, 0, SvgExportFlag.ConvertTextToPaths) 
canvas.height = 400 // doesn't work, the height is default 150

Can we add a setter to SvgCanvas to match Canvas api?