M3.72: Tile Edge Color dialog and Show Swatch Bounds in pattern editing

Object > Pattern > Tile Edge Color... picks the colour of the tile edge
(a layer-colour preset or a custom colour), stored in the preference
patternTileEdgeColor and passed to the renderer. Pattern Options gains
Show Swatch Bounds: a dashed outline of the part of the tiling the swatch
repeats (the period of brick and hex tilings).

Commands: prefs.set {patternTileEdgeColor}, pattern.options
{showSwatchBounds}, ui.tileEdgeColor. Model: PatternDef.show_swatch_bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-05 01:50:25 +07:00
co-authored by Claude Opus 5.5
parent d8b942c43d
commit b36fd67bf4
15 changed files with 343 additions and 5 deletions
+10 -2
View File
@@ -194,9 +194,17 @@ impl Renderer {
});
}
self.draw_arc(ctx, f, layer);
let [r, g, b] = f.opts.tile_edge;
if def.show_tile_edge {
let bp = def.tile.to_path(0.1);
self.hairline(ctx, f, &bp, [0x2d, 0x8c, 0xeb, 255]);
self.hairline(ctx, f, &def.tile.to_path(0.1), [r, g, b, 255]);
}
if def.show_swatch_bounds {
let mut bounds = def.swatch_bounds().to_path(0.1);
bounds.apply_affine(f.view);
ctx.set_transform(Affine::IDENTITY);
ctx.set_stroke(vello_cpu::kurbo::Stroke::new(1.0).with_dashes(0.0, [4.0, 3.0]));
ctx.set_paint(peniko::Color::from_rgba8(r, g, b, 255));
ctx.stroke_path(&bounds);
}
true
}