README.markdown

Canvas Context 2D Wrapper

It's intended to be simple, small and not add new functionalities besides method chaining, it doesn't overwrite the native prototypes/objects and can be used interchangeably with native Context2D methods/properties, works just as a wrapper to native calls.

Why?

Sometimes method chaining can be a good solution for code brevity and a lot of developers got used to it because of popular JavaScript frameworks like jQuery and prototype.

Existing solutions are too big or more complex than what I needed.

No need to learn a new API and also small file size (~1KB without gzip).

How to Use

Include Context2DWrapper-X.X.min.js on your HTML5 document:

<script src="Context2DWrapper-X.X.min.js"></script>

Get the reference of the CanvasRenderingContext2D that you want to wrap and create a new Context2DWrapper: