// adjust corner for the inner path (formula found by experimenting)
double zoomedCorner = (getPositionedContextButton().getCornerRadius() * zoom);
int corner = (int) Math.max(1, zoomedCorner - (((shrinkLines - 1) * lw) + zoomedCorner / 64));
Path path = new Path(null);
path.moveTo(r.x, r.y);
path.addArc(r.x, r.y, corner, corner, 90, 90);
path.addArc(r.x, r.y + r.height - corner, corner, corner, 180, 90);
path.addArc(r.x + r.width - corner, r.y + r.height - corner, corner, corner, 270, 90);
path.addArc(r.x + r.width - corner, r.y, corner, corner, 0, 90);
path.close();