private void addRoundRectPath(float x, float y, float width, float height, float radius) { float midx = x + width/2, midy = y + height/2, maxx = x + width, maxy = y + height; ctx.beginPath(); ctx.moveTo(x, midy); ctx.arcTo(x, y, midx, y, radius); ctx.arcTo(maxx, y, maxx, midy, radius); ctx.arcTo(maxx, maxy, midx, maxy, radius); ctx.arcTo(x, maxy, x, midy, radius); ctx.closePath(); }
private void addRoundRectPath(float x, float y, float width, float height, float radius) { float midx = x + width/2, midy = y + height/2, maxx = x + width, maxy = y + height; ctx.beginPath(); ctx.moveTo(x, midy); ctx.arcTo(x, y, midx, y, radius); ctx.arcTo(maxx, y, maxx, midy, radius); ctx.arcTo(maxx, maxy, midx, maxy, radius); ctx.arcTo(x, maxy, x, midy, radius); ctx.closePath(); }
private void addRoundRectPath(float x, float y, float width, float height, float radius) { float midx = x + width/2, midy = y + height/2, maxx = x + width, maxy = y + height; ctx.beginPath(); ctx.moveTo(x, midy); ctx.arcTo(x, y, midx, y, radius); ctx.arcTo(maxx, y, maxx, midy, radius); ctx.arcTo(maxx, maxy, midx, maxy, radius); ctx.arcTo(x, maxy, x, midy, radius); ctx.closePath(); }