Closed peterolson closed 3 years ago
There's not an easy way to do that currently, aside from doing something fancy with an SVG G element, or just deleting and recreating the HanziWriter element. I think it should be doable though to add an updateDimensions()
method that will recreate the image elements in the new size while keeping the state the same. The user-drawn stroke path might be a bit weird, but maybe it will just work. I'll work on a PR...
:tada: This issue has been resolved in version 3.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Awesome, works like a charm!
Once I've already created a writer with
HanziWriter.create
, is there any way to change the width and height dynamically?I'm setting the size of the writer based on the size of the window, but this breaks when the window is resized after the writer is created.