livewires / you-win

a friendly games library for young people who've probably used Scratch before
https://livewires.github.io/you-win/install
8 stars 1 forks source link

Avoid zero-dimension canvases #20

Closed tjvr closed 7 years ago

tjvr commented 7 years ago

When we create a Text object, its default value is the empty string.

var text = new Text

Sometimes this makes Safari throw an exception, because we try and draw a canvas with a width/height of zero.

If the image argument is an HTMLCanvasElement object with either a horizontal dimension or a vertical dimension equal to zero, then the implementation must raise an INVALID_STATE_ERR exception.

This might apply to Polygons too!