Reduce some logic redundancy in clearRect/fillRect code for Canvas...?

Topic.
Update CanvasRenderer.js
Update CanvasRenderer.js
Merge pull request #996 from agamemnus/patch-5

Reduce some logic redundancy in clearRect/fillRect code for Canvas...?