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:
+24
-12
@@ -597,6 +597,14 @@ export default function Develop({
|
||||
: view,
|
||||
);
|
||||
|
||||
// The mask overlay is the baked mask itself, so it can only be shown when a
|
||||
// local layer is selected. The histogram ignores it: a tinted chart is not
|
||||
// a measurement of the photo.
|
||||
const maskView =
|
||||
showOriginal || !localMode
|
||||
? -1
|
||||
: (edits.local ?? []).findIndex((layer) => layer.id === localSelected);
|
||||
|
||||
try {
|
||||
renderer.setImage(bitmap, hdrSource);
|
||||
// "Show original" must show the untouched source, not the cleaned proxy.
|
||||
@@ -606,7 +614,7 @@ export default function Develop({
|
||||
height: pxH,
|
||||
cropPreview: cropMode,
|
||||
// The histogram describes the whole photo, so it is only refreshed at fit.
|
||||
histogram: !cropMode && !showOriginal && zoomFactor <= 1.0001,
|
||||
histogram: !cropMode && !showOriginal && zoomFactor <= 1.0001 && maskView < 0,
|
||||
view: zoomFactor <= 1.0001 ? undefined : view,
|
||||
// Holding the grain still keeps the noise from crawling while a crop
|
||||
// handle moves; the new crop-relative scale applies on release.
|
||||
@@ -618,6 +626,7 @@ export default function Develop({
|
||||
clipping: clipping ?? undefined,
|
||||
lens: showOriginal ? null : lensCorrection,
|
||||
lensSplit: lensSplit && !showOriginal ? lensSplitAt : undefined,
|
||||
maskView,
|
||||
});
|
||||
histRef.current = renderer.histogram;
|
||||
setHistVersion((v) => v + 1);
|
||||
@@ -639,6 +648,8 @@ export default function Develop({
|
||||
lensCorrection,
|
||||
lensSplit,
|
||||
lensSplitAt,
|
||||
localMode,
|
||||
localSelected,
|
||||
// Loading or clearing a printer profile changes the finish pass, and the
|
||||
// cube lives outside the edit record, so the redraw is keyed on it here.
|
||||
proofProfile,
|
||||
@@ -2210,36 +2221,37 @@ export default function Develop({
|
||||
/** Brush diameter in canvas pixels, for the stroke preview. */
|
||||
const diameterPx = (r: number) => (r * 2 * bitmap.width * canvasW) / (frame.w * view.w);
|
||||
const feather = Math.max(0, Math.min(1, activeComponent.feather / 100));
|
||||
const strokes = localDraft
|
||||
? [...activeComponent.brush.strokes, localDraft]
|
||||
: activeComponent.brush.strokes;
|
||||
// Committed strokes are not redrawn here: the shader tints the
|
||||
// baked mask, which is the real feathered shape. Only the stroke
|
||||
// in progress is drawn, as a preview of what will be baked.
|
||||
const draft = localDraft && localDraft.points.length ? localDraft : null;
|
||||
return (
|
||||
<svg className="local-layer" viewBox="0 0 100 100" preserveAspectRatio="none">
|
||||
{activeComponent.kind === 'brush' &&
|
||||
strokes.map((stroke, i) => {
|
||||
if (!stroke.points.length) return null;
|
||||
const points = stroke.points.map(marker).map((p) => `${p.x},${p.y}`).join(' ');
|
||||
const width = Math.max(1, diameterPx(stroke.size));
|
||||
(() => {
|
||||
if (!draft) return null;
|
||||
const points = draft.points.map(marker).map((p) => `${p.x},${p.y}`).join(' ');
|
||||
const width = Math.max(1, diameterPx(draft.size));
|
||||
const core = Math.max(1, width * (1 - feather));
|
||||
return (
|
||||
<g key={i}>
|
||||
<g>
|
||||
{core < width - 0.5 && (
|
||||
<polyline
|
||||
points={points}
|
||||
className={`local-brush band ${stroke.erase ? 'erase' : ''}`}
|
||||
className={`local-brush band ${draft.erase ? 'erase' : ''}`}
|
||||
strokeWidth={width}
|
||||
vectorEffect="non-scaling-stroke"
|
||||
/>
|
||||
)}
|
||||
<polyline
|
||||
points={points}
|
||||
className={`local-brush ${stroke.erase ? 'erase' : ''}`}
|
||||
className={`local-brush ${draft.erase ? 'erase' : ''}`}
|
||||
strokeWidth={core}
|
||||
vectorEffect="non-scaling-stroke"
|
||||
/>
|
||||
</g>
|
||||
);
|
||||
})}
|
||||
})()}
|
||||
{activeComponent.kind === 'radial' && (() => {
|
||||
const c = marker({ x: activeComponent.radial.cx, y: activeComponent.radial.cy });
|
||||
const edge = marker({
|
||||
|
||||
Reference in New Issue
Block a user