mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-24 01:40:41 +02:00
tweak animation some more + remove countdown
This commit is contained in:
@@ -383,10 +383,12 @@ const renderBindingHighlightForBindableElement = (
|
|||||||
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;
|
||||||
|
|
||||||
context.strokeStyle = "rgba(0, 0, 0, 0.2)";
|
context.strokeStyle = "rgba(0, 0, 0, 0.2)";
|
||||||
context.lineWidth = 1 / appState.zoom.value;
|
context.lineWidth = 1 / appState.zoom.value;
|
||||||
context.setLineDash([4 / appState.zoom.value, 4 / 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.beginPath();
|
||||||
context.ellipse(
|
context.ellipse(
|
||||||
@@ -415,16 +417,6 @@ const renderBindingHighlightForBindableElement = (
|
|||||||
|
|
||||||
context.fill();
|
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();
|
context.restore();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Reference in New Issue
Block a user