Skip to content

Clearing does not consider transform #12

@roboshoes

Description

@roboshoes

When the canvas has a transform applied, let's say context.translate( 10, 10 ) then the clearing will be off by 10 pixels as it's done via context.clearRect( 0, 0, canvas.width, canvas.height ).

A simple workaround is canvas.width = canvas.width though less performant.

Another solution would be:

context.save();
context.setTranfsorm( 1, 0, 0, 1 0, 0 );
context.clearRect( canvas.width, canvas.height );
context.restore();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions