fix: align psd layer hit testing
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-05-14 15:48:13 +08:00
parent 5e7809687c
commit a3a41ef6e6

View File

@ -4043,6 +4043,8 @@ export function AgentPsdTemplateEditorDialog({
const layerPositionOffset =
effectiveLayerPositionOffsets[layer.id] ||
normalizeLayerPositionOffset();
const baseZIndex =
layerStackZIndexById.get(layer.id) || 1;
const layerBoxStyle = {
left: layer.x + layerPositionOffset.offsetX,
top: layer.y + layerPositionOffset.offsetY,
@ -4076,7 +4078,16 @@ export function AgentPsdTemplateEditorDialog({
onPointerDown={(event) =>
handleLayerDragStart(layer, event)
}
style={assignedImageContainerStyle}
style={{
...assignedImageContainerStyle,
zIndex: baseZIndex,
cursor:
layerDragStateRef.current?.layerId ===
layer.id
? "grabbing"
: "grab",
touchAction: "none",
}}
title={`${getLayerLabel(layer)}:${layer.layerName}`}
>
<img
@ -4148,7 +4159,16 @@ export function AgentPsdTemplateEditorDialog({
onPointerDown={(event) =>
handleTextDragStart(layer, event)
}
style={layerBoxStyle}
style={{
...layerBoxStyle,
zIndex: baseZIndex,
cursor:
textDragStateRef.current?.layerId ===
layer.id
? "grabbing"
: "grab",
touchAction: "none",
}}
title={`${getLayerLabel(layer)}:${layer.layerName}`}
>
<img
@ -4197,6 +4217,7 @@ export function AgentPsdTemplateEditorDialog({
textFrame.offsetY,
width: textFrame.width,
height: textFrame.height,
zIndex: baseZIndex,
cursor:
textDragStateRef.current?.layerId ===
layer.id