HanSolo / SteelSeries-Canvas

The HTML5 Canvas port of the SteelSeries component library. Mainly contains gauges.
120 stars 76 forks source link

suggestion: removing translate just before ctx.restore() #31

Open Dierk opened 5 years ago

Dierk commented 5 years ago

There is a number of places where a translate() is called just before ctx.restore(), e.g. at https://github.com/HanSolo/SteelSeries-Canvas/blob/80a71a1e8830f9f61d3b20fc7ba8198f17f00702/steelseries.js#L417-L418

but since translation goes into the transformation matrix and this is part of the save()-ed state and thus restore()-ed it should be possible to remove the translate() call.

mcrossley commented 4 years ago

Yes, those translates are superfluous and can be removed.