mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Binding gap correctly represent the area where the arrow can bind
This commit is contained in:
parent
e51e72c676
commit
3054be4c20
1 changed files with 3 additions and 4 deletions
|
@ -17,7 +17,6 @@ import {
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BINDING_HIGHLIGHT_OFFSET,
|
BINDING_HIGHLIGHT_OFFSET,
|
||||||
BINDING_HIGHLIGHT_THICKNESS,
|
|
||||||
maxBindingGap,
|
maxBindingGap,
|
||||||
} from "@excalidraw/element/binding";
|
} from "@excalidraw/element/binding";
|
||||||
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
|
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
|
||||||
|
@ -261,9 +260,9 @@ const renderBindingHighlightForBindableElement = (
|
||||||
const height = y2 - y1;
|
const height = y2 - y1;
|
||||||
|
|
||||||
context.strokeStyle = "rgba(0,0,0,.05)";
|
context.strokeStyle = "rgba(0,0,0,.05)";
|
||||||
// When zooming out, make line width greater for visibility
|
context.lineWidth =
|
||||||
const zoomValue = zoom.value < 1 ? zoom.value : 1;
|
maxBindingGap(element, element.width, element.height, zoom) -
|
||||||
context.lineWidth = BINDING_HIGHLIGHT_THICKNESS / zoomValue;
|
BINDING_HIGHLIGHT_OFFSET;
|
||||||
// To ensure the binding highlight doesn't overlap the element itself
|
// To ensure the binding highlight doesn't overlap the element itself
|
||||||
const padding = context.lineWidth / 2 + BINDING_HIGHLIGHT_OFFSET;
|
const padding = context.lineWidth / 2 + BINDING_HIGHLIGHT_OFFSET;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue