rezoner / CanvasQuery

Canvas for 2d gamedevelopers. Out of box canvas, keyboard, mouse, events.
http://canvasquery.com
586 stars 52 forks source link

bug fix for recursive save() and restore() #48

Closed bchoii closed 8 years ago

bchoii commented 8 years ago

html5's canvas save() and restore() supports multiple recursive calls, as in

save()
  save()
  restore()
restore()

It would be reasonable to expect CQ to also perform similarly.

But CQ's prevAlignX and prevAlignY are overwritten if cq().save() / cq().restore() is called more than once.

This change introduces a stack to store multiple prevAlign values.

bchoii commented 8 years ago

Duplicate of #49 . Please ignore this request.