Skip to content

Commit f5c1a2e

Browse files
Drag fix for the 0th column. (#1050)
Spotted by @microbit-robert
1 parent 9c9e8e6 commit f5c1a2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/editor/codemirror/dnd.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ const findLogicalPosition = (
225225
x: event.x || event.clientX,
226226
y: event.y || event.clientY,
227227
});
228-
const column = pos ? pos - visualLine.from : undefined;
229-
const indent = column ? Math.floor(column / 4) : undefined;
228+
const column = pos !== null ? pos - visualLine.from : undefined;
229+
const indent = column !== undefined ? Math.floor(column / 4) : undefined;
230230
return {
231231
line: line.number,
232232
indent,

0 commit comments

Comments
 (0)