npm.io
0.1.0 • Published 7 years ago

canvas-handle

Licence
ISC
Version
0.1.0
Deps
1
Size
74 kB
Vulns
0
Weekly
0

Canvas methods enhance

How to use

  1. get canvas ctx and add enhance methods to ctx
    var canvas = document.getElementById('canvas')
    var ctx = canvas.getContext('2d')
    ctx = new canvasHandle(ctx)
  1. use provide methods
    ctx.strokeRoundRect(10,10,100,100,2,'#f00',[20,20,20,20])
    ctx.fillRoundRect(10,10,100,100,'#f00',[20,20,20,20])

Keywords