TehShrike / get-text-fit-size

Find out what font size will make a text block fit inside of another element without wrapping
1 stars 1 forks source link

reuse canvas element #1

Open futurist opened 6 years ago

futurist commented 6 years ago

Each time call the main function, that will create a canvas using createCanvas()

Can set a context canvas as global, and re-use that one canvas for all later call?

TehShrike commented 6 years ago

I feel nervous having a stateful gobal around, but it seeeems like that shouldn't be a problem?