Repository navigation
Commit 0e32253
committed
fix(canvas): snap whole-line drag and guard image div-by-zero
LineObject's whole-line onDragMove only updated dragDelta with the
raw cursor delta — the endpoint handles in the same component snap,
and the rest of the canvas snaps too, so the inconsistency was
visible. Mirror the endpoint idiom: round-trip pixel → dot → snap →
pixel, then update both Konva position and the React state.
ImageObject divided cached.height by cached.width to compute aspect
ratio. A 0-width image would yield NaN. Guard with width > 0; falls
back to a square placeholder.1 parent a783674 commit 0e32253
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
| |||
0 commit comments