dojox.gfx.Rect._renderShape
dojo.require("dojox.gfx.canvas");
defined in dojox/gfx/canvas.js
Usage
function (/*
Object*/ ctx)
(view source) var s = this.shape, r = Math.min(s.r, s.height / 2, s.width /|> 2),
xl = s.x, xr = xl + s.width, yt = s.y, yb = yt + s.height,
xl2 = xl + r, xr2 = xr - r, yt2 = yt + r, yb2 = yb - r;
ctx.beginPath();
ctx.moveTo(xl2, yt);
if(r){
ctx.arc(xr2, yt2, r, -halfPI, 0, false);
ctx.arc(xr2, yb2, r, 0, halfPI, false);
ctx.arc(xl2, yb2, r, halfPI, pi, false);
ctx.arc(xl2, yt2, r, pi, halfPI, false);
}else{
ctx.lineTo(xr2, yt);
ctx.lineTo(xr, yb2);
ctx.lineTo(xl2, yb);
ctx.lineTo(xl, yt2);
}
ctx.closePath();
parameter | type | description |
---|
ctx | Object | |