From dba41c4116e5f995289a5e4600956f3b20480aea Mon Sep 17 00:00:00 2001 From: dwelle <5153846+dwelle@users.noreply.github.com> Date: Fri, 19 Sep 2025 19:58:01 +0200 Subject: [PATCH] tweak animation some more + remove countdown --- packages/excalidraw/renderer/interactiveScene.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/excalidraw/renderer/interactiveScene.ts b/packages/excalidraw/renderer/interactiveScene.ts index 2643082e4a..4dfeb81f2b 100644 --- a/packages/excalidraw/renderer/interactiveScene.ts +++ b/packages/excalidraw/renderer/interactiveScene.ts @@ -383,10 +383,12 @@ const renderBindingHighlightForBindableElement = ( context.save(); context.translate(element.x + appState.scrollX, element.y + appState.scrollY); + const PROGRESS_RATIO = (1 / BIND_MODE_TIMEOUT) * remainingTime; + context.strokeStyle = "rgba(0, 0, 0, 0.2)"; context.lineWidth = 1 / appState.zoom.value; context.setLineDash([4 / appState.zoom.value, 4 / appState.zoom.value]); - context.lineDashOffset = 0; + context.lineDashOffset = (-PROGRESS_RATIO * 10) / appState.zoom.value; context.beginPath(); context.ellipse( @@ -415,16 +417,6 @@ const renderBindingHighlightForBindableElement = ( context.fill(); - // Draw countdown - context.font = `${radius / 2}px sans-serif`; - context.textAlign = "center"; - context.textBaseline = "middle"; - context.fillText( - `${Math.round(remainingTime)}`, - element.width / 2, - element.height / 2, - ); - context.restore(); return {