Open Dierk opened 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.
save()
restore()
Yes, those translates are superfluous and can be removed.
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 thusrestore()
-ed it should be possible to remove the translate() call.