fix: align local edit selection handles
This commit is contained in:
parent
f42554e82a
commit
6e6acea09e
@ -8128,7 +8128,7 @@ export function ImageNode({
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"nodrag nopan nowheel pointer-events-auto absolute z-[160] rounded-[10px] border-[3px] bg-transparent shadow-[0_0_0_1px_rgba(255,255,255,0.92),0_0_22px_rgba(0,0,0,0.2)]",
|
||||
"nodrag nopan nowheel pointer-events-auto absolute z-[160] rounded-none border-[1.5px] bg-transparent shadow-none",
|
||||
localEditRegionInteraction?.regionId === region.id
|
||||
? "cursor-grabbing"
|
||||
: "cursor-grab"
|
||||
@ -8160,43 +8160,37 @@ export function ImageNode({
|
||||
borderColor: region.color,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="-left-3 -top-3 absolute flex h-7 w-7 items-center justify-center rounded-full border-2 border-white text-[12px] font-black text-white shadow-[0_8px_18px_rgba(0,0,0,0.22)]"
|
||||
style={{ backgroundColor: region.color }}
|
||||
>
|
||||
{region.index}
|
||||
</div>
|
||||
{(
|
||||
[
|
||||
{
|
||||
handle: "nw",
|
||||
className: "-left-2 -top-2 cursor-nwse-resize",
|
||||
className: "-left-[5px] -top-[5px] cursor-nwse-resize",
|
||||
},
|
||||
{
|
||||
handle: "ne",
|
||||
className: "-right-2 -top-2 cursor-nesw-resize",
|
||||
className: "-right-[5px] -top-[5px] cursor-nesw-resize",
|
||||
},
|
||||
{
|
||||
handle: "sw",
|
||||
className: "-left-2 -bottom-2 cursor-nesw-resize",
|
||||
className: "-left-[5px] -bottom-[5px] cursor-nesw-resize",
|
||||
},
|
||||
{
|
||||
handle: "se",
|
||||
className: "-right-2 -bottom-2 cursor-nwse-resize",
|
||||
className: "-right-[5px] -bottom-[5px] cursor-nwse-resize",
|
||||
},
|
||||
] as const
|
||||
).map((item) => (
|
||||
<button
|
||||
aria-label={`调整区域 ${region.index}`}
|
||||
className={cn(
|
||||
"nodrag nopan nowheel absolute h-4 w-4 rounded-full border-2 border-white shadow-[0_4px_12px_rgba(0,0,0,0.22)]",
|
||||
"nodrag nopan nowheel absolute h-[10px] w-[10px] rounded-none border-[1.5px] bg-white shadow-none",
|
||||
item.className
|
||||
)}
|
||||
data-canvas-no-drag="true"
|
||||
data-local-edit-control="true"
|
||||
data-local-edit-region-handle={item.handle}
|
||||
key={item.handle}
|
||||
style={{ backgroundColor: region.color }}
|
||||
style={{ borderColor: region.color }}
|
||||
type="button"
|
||||
/>
|
||||
))}
|
||||
@ -8504,7 +8498,7 @@ export function ImageNode({
|
||||
: null}
|
||||
{localEditDraftRectStyle ? (
|
||||
<div
|
||||
className="pointer-events-none absolute z-[162] rounded-[10px] border-[3px] border-emerald-400 bg-emerald-300/10 shadow-[0_0_0_1px_rgba(255,255,255,0.9),0_0_22px_rgba(16,185,129,0.35)]"
|
||||
className="pointer-events-none absolute z-[162] rounded-none border-[1.5px] border-[#27a8ff] bg-transparent shadow-none"
|
||||
style={{
|
||||
left: localEditDraftRectStyle.left,
|
||||
top: localEditDraftRectStyle.top,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user