Show the baked local mask in the develop view instead of a drawn band.

The overlay redrew every stroke as a flat translucent band, so the feather
never appeared and the guide did not match the shape it stood for. The
develop view now tints the selected layer's baked mask, sampled with the
same source uv the adjustments use: the preview follows crops,
straightening, zoom, lens correction, subtract shapes and the feather
exactly as the mask stores it. Only the stroke still under the pointer is
drawn, as a preview of what will be baked, and the histogram is left
alone while a tint is showing.

The render gate now checks the overlay ranks its tint from the dab core
through the feathered rim to untouched pixels outside the brush circle.
This commit is contained in:
2026-11-28 17:14:00 +00:00
parent c05dbce580
commit 46dcc231a7
3 changed files with 69 additions and 15 deletions
+24 -2
View File
@@ -296,6 +296,13 @@ try {
const dabSoft = pixelAt(0.25, 0.2);
const dabRimSoft = pixelAt(0.25, 0.2 + dabRadiusY * 0.75);
const dabOutsideSoft = pixelAt(0.25, 0.2 + dabRadiusY * 1.15);
// The develop view tints the baked mask instead of redrawing the stroke, so
// the overlay has to follow the same coverage: strong in the core, a real
// gradient at the rim, and nothing at all outside the brush circle.
renderer.render(brushEdits(80), { width: w, height: h, maskView: 0 });
const tintCore = pixelAt(0.25, 0.2);
const tintRim = pixelAt(0.25, 0.2 + dabRadiusY * 0.75);
const tintOutside = pixelAt(0.25, 0.2 + dabRadiusY * 1.15);
pre.textContent = 'RESULT ' + JSON.stringify({
clipPixels,
@@ -328,6 +335,13 @@ try {
dabSoft,
dabRimSoft,
dabOutsideSoft,
tintCore,
tintRim,
tintOutside,
// Orange tint: blue is the channel the overlay pushes up, so it ranks the
// coverage without depending on how dark the adjustment left the pixels.
tintFollowsMask: tintCore[2] > tintRim[2] && tintRim[2] > tintOutside[2] + 5,
tintBounded: Math.abs(tintOutside[2] - dabOutsideSoft[2]) <= 1,
// A hard dab covers the core, and even an 80 % feather stops at the rim.
dabCoreDarkened: dabHard[0] < 140,
dabSoftCoreDarkened: dabSoft[0] < 140,
@@ -554,18 +568,26 @@ async function main() {
` outsideHard=${JSON.stringify(result.dabOutsideHard)} soft=${JSON.stringify(result.dabSoft)}` +
` rimSoft=${JSON.stringify(result.dabRimSoft)} outsideSoft=${JSON.stringify(result.dabOutsideSoft)}`,
);
console.log(
`render check: mask overlay core=${JSON.stringify(result.tintCore)}` +
` rim=${JSON.stringify(result.tintRim)} outside=${JSON.stringify(result.tintOutside)}`,
);
if (
!result.dabCoreDarkened ||
!result.dabSoftCoreDarkened ||
!result.dabRimSmooth ||
!result.dabBoundedHard ||
!result.dabBoundedSoft
!result.dabBoundedSoft ||
!result.tintFollowsMask ||
!result.tintBounded
) {
console.error(
'render check FAILED: the brush mask does not follow the brush circle ' +
`(hard=${JSON.stringify(result.dabHard)}, rim=${JSON.stringify(result.dabRimSoft)}, ` +
`outsideHard=${JSON.stringify(result.dabOutsideHard)}, ` +
`outsideSoft=${JSON.stringify(result.dabOutsideSoft)}).`,
`outsideSoft=${JSON.stringify(result.dabOutsideSoft)}, ` +
`tint=${JSON.stringify(result.tintCore)}/${JSON.stringify(result.tintRim)}/` +
`${JSON.stringify(result.tintOutside)}).`,
);
return 1;
}