feat: Bind to frame when frame-bound object hidden part is approached

This commit is contained in:
Mark Tolmacs
2025-10-21 18:28:44 +02:00
parent 7e10773ecf
commit 12c67386cf
2 changed files with 41 additions and 36 deletions

View File

@@ -596,15 +596,15 @@ export const getBindingStrategyForDraggingBindingElementEndpoints = (
return { return {
start: startDragged start: startDragged
? { ? {
mode: "inside", mode: "orbit",
element: hoveredElement, element: enclosingFrame,
focusPoint: globalPoint, focusPoint: globalPoint,
} }
: start, : start,
end: endDragged end: endDragged
? { ? {
mode: "inside", mode: "orbit",
element: hoveredElement, element: enclosingFrame,
focusPoint: globalPoint, focusPoint: globalPoint,
} }
: end, : end,

View File

@@ -409,8 +409,12 @@ const renderBindingHighlightForBindableElement = (
const radius = 0.5 * (Math.min(element.width, element.height) / 2); const radius = 0.5 * (Math.min(element.width, element.height) / 2);
// Draw center snap area // Draw center snap area
if (!isFrameLikeElement(element)) {
context.save(); context.save();
context.translate(element.x + appState.scrollX, element.y + appState.scrollY); context.translate(
element.x + appState.scrollX,
element.y + appState.scrollY,
);
const PROGRESS_RATIO = (1 / BIND_MODE_TIMEOUT) * remainingTime; const PROGRESS_RATIO = (1 / BIND_MODE_TIMEOUT) * remainingTime;
@@ -447,6 +451,7 @@ const renderBindingHighlightForBindableElement = (
context.fill(); context.fill();
context.restore(); context.restore();
}
return { return {
runtime: (state?.runtime ?? 0) + deltaTime, runtime: (state?.runtime ?? 0) + deltaTime,