mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-10-26 16:34:22 +01:00
feat: Bind to frame when frame-bound object hidden part is approached
This commit is contained in:
@@ -596,15 +596,15 @@ export const getBindingStrategyForDraggingBindingElementEndpoints = (
|
||||
return {
|
||||
start: startDragged
|
||||
? {
|
||||
mode: "inside",
|
||||
element: hoveredElement,
|
||||
mode: "orbit",
|
||||
element: enclosingFrame,
|
||||
focusPoint: globalPoint,
|
||||
}
|
||||
: start,
|
||||
end: endDragged
|
||||
? {
|
||||
mode: "inside",
|
||||
element: hoveredElement,
|
||||
mode: "orbit",
|
||||
element: enclosingFrame,
|
||||
focusPoint: globalPoint,
|
||||
}
|
||||
: end,
|
||||
|
||||
@@ -409,8 +409,12 @@ const renderBindingHighlightForBindableElement = (
|
||||
const radius = 0.5 * (Math.min(element.width, element.height) / 2);
|
||||
|
||||
// Draw center snap area
|
||||
if (!isFrameLikeElement(element)) {
|
||||
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;
|
||||
|
||||
@@ -447,6 +451,7 @@ const renderBindingHighlightForBindableElement = (
|
||||
context.fill();
|
||||
|
||||
context.restore();
|
||||
}
|
||||
|
||||
return {
|
||||
runtime: (state?.runtime ?? 0) + deltaTime,
|
||||
|
||||
Reference in New Issue
Block a user