When scaling the canvas using ctx.scale() method, it scales around the origin (0, 0). This is counter intuitive for my canvas application, and having it scale around the center of the canvas is much more pleasing, and a better experience overall.
Fix
After scaling the canvas, a translation is applied to it, to counteract the movement caused by the pivot being off-center.
Issues introduced
While examining the code, an inconsistency was identified between the canvas position and the Rigidbodies positions, causing major issues with the zoom fix. The issue was corrected, but some parameters have to be fine-tuned to limit the canvas movement, in order to not break the application.
Canvas normal scaling operation
When scaling the canvas using ctx.scale() method, it scales around the origin (0, 0). This is counter intuitive for my canvas application, and having it scale around the center of the canvas is much more pleasing, and a better experience overall.
Fix
After scaling the canvas, a translation is applied to it, to counteract the movement caused by the pivot being off-center.
Issues introduced
While examining the code, an inconsistency was identified between the canvas position and the Rigidbodies positions, causing major issues with the zoom fix. The issue was corrected, but some parameters have to be fine-tuned to limit the canvas movement, in order to not break the application.
This pull request closes #20