On Mon, 10 Jun 2019 21:02:28 GMT, Ron Tarrant wrote:

On Mon, 10 Jun 2019 19:52:46 +0200, Mike Wey wrote:
Is there something else in here that's throwing things off, something I've missed?

double[] dashPattern = [5.0, 10.0, 15.0, 20.0];
// set up and draw a dashed-line rectangle
context.setLineWidth(3);
context.setLineCap(CairoLineCap.SQUARE);
context.setSourceRgba(0.1, 0.2, 0.3, 0.8); // pen color with alpha
context.rectangle(150, 100, 340, 170); // rectangle upper-left/width/height
context.setDash(dashPattern, 0.0);
context.stroke();

Never mind, Mike. I figured it out. Setting the line caps throws things off visually.