mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-12 11:59:58 +02:00
fix: improve line creation ux on touch screens (#9740)
* fix: awkward point adding and removing on touch device * feat: move finalize to next to last point * feat: on touch screen, click would create a default line/arrow * fix: make default adaptive to zoom * fix: increase padding to avoid cutoffs * refactor: simplify * fix: only use bigger padding when needed * center arrow horizontally on pointer * increase min drag distance before we start 2-point-arrow-drag-creating * do not render 0-width arrow while creating * dead code * fix tests * fix: remove redundant code * do not enter line editor on creation --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
@@ -106,6 +106,11 @@ const getCanvasPadding = (element: ExcalidrawElement) => {
|
||||
return element.strokeWidth * 12;
|
||||
case "text":
|
||||
return element.fontSize / 2;
|
||||
case "arrow":
|
||||
if (element.endArrowhead || element.endArrowhead) {
|
||||
return 40;
|
||||
}
|
||||
return 20;
|
||||
default:
|
||||
return 20;
|
||||
}
|
||||
|
Reference in New Issue
Block a user