Open marrus-sh opened 7 years ago
Ideally, Letters
should detect any changes to the source
element, and redraw whenever this occurs. Perhaps a toggle controlling this behaviour would be useful?
(Note that this may also require resizing the canvas.)
In line with ^, letter_width
and letter_height
should be redone with getters and setters which allow for them to be changed, triggering a complete redraw. This might be overkill though, because at this point you might as well just create a new Letters
object?
The alternate approach to this would be to clone source
's image data after it is loaded and not allow any changes whatsoever, but this might also mean dropping support for initially-unloaded <img>
s
Namely, through
source.addEventListener("load", ltrs.clearColor.bind(ltrs), false)
.