Group local mask shapes into editable components.

A local adjustment is now a list of shapes composited in order (add, subtract,
intersect) instead of a single shape, so dodging and burning can be built from
several brushes, gradients and auto masks without spending layer channels.
Existing edits migrate on load: the flat layer fields become components[0],
keeping geometry, invert, feather and the layer's blend mode unchanged. The
panel gains a shape list with active-shape editing, and the render gate now
asserts a subtract shape clears the group while an intersect keeps it.
This commit is contained in:
2026-11-28 16:09:14 +00:00
parent acf582251f
commit b884616889
10 changed files with 666 additions and 183 deletions
+4 -8
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { defaultEdits, normalizeEdits } from './edits';
import { defaultEdits, defaultLocalLayer, normalizeEdits } from './edits';
import { editsToXmp, xmpFileName, xmpToEdits } from './xmp';
describe('xmp sidecars', () => {
@@ -12,13 +12,9 @@ describe('xmp sidecars', () => {
edits.parametric.darks = -17;
edits.hsl.hue[3] = 12;
edits.grain.roughness = 71;
edits.local = [
{
...defaultEdits().local[0],
kind: 'linear',
linear: { x1: 0.1, y1: 0.2, x2: 0.8, y2: 0.9 },
},
];
const mask = defaultLocalLayer('linear', 0);
if (mask.components[0]) mask.components[0].linear = { x1: 0.1, y1: 0.2, x2: 0.8, y2: 0.9 };
edits.local = [mask];
const xml = editsToXmp(edits);
const back = xmpToEdits(xml, defaultEdits());