- context->move_to (intersect->x0, self.y0 + ((self.y1 - self.y0)/2.0));
- context->line_to (intersect->x1, self.y0 + ((self.y1 - self.y0)/2.0));
+
+ /* Not 100% sure that the computation of the invariant
+ * positions (y and x) below work correctly if the line width
+ * is not 1.0, but visual inspection suggests it is OK.
+ */
+
+ if (_orientation == Horizontal) {
+ double y = self.y0 + ((self.y1 - self.y0)/2.0);
+ context->move_to (intersection.x0, y);
+ context->line_to (intersection.x1, y);
+ } else {
+ double x = self.x0 + ((self.x1 - self.x0)/2.0);
+ context->move_to (x, intersection.y0);
+ context->line_to (x, intersection.y1);
+ }
+