JakeSidSmith / canvasimo

An HTML5 canvas drawing library, with 150+ useful methods, jQuery-like fluent interface, and cross-browser compatibility enhancements.
http://canvasimo.com
MIT License
16 stars 2 forks source link

Font sizes are not reset when clearing the canvas #114

Closed JakeSidSmith closed 5 years ago

JakeSidSmith commented 6 years ago

This may also extend to other density related values.

// Initial value
// ctx.font = 'normal normal normal 10px sans-serif';

canvas.setDensity(2);

// Correct
// ctx.font = 'normal normal normal 20px sans-serif';

canvas
  .clearCanvas();

// Incorrect
// ctx.font = '10px sans-serif';

canvas
  .clearCanvas()
  .setDensity(2);

// Correct
// ctx.font = 'normal normal normal 20px sans-serif';

Rather than requiring the density to be manually set, this should be handled in the clearCanvas method.