Context
v1 hands off to the native lasso so the user drags manually. The OneNote-style target is a single gesture: drag down and everything below the line shifts automatically by the drag delta — no manual lasso drag.
Why this is hard (the core of v2)
The SDK has no "move selection" API (resizeLassoRect = proportional scale only). Auto-move must rewrite each element's position by hand:
- Stroke: shift every sample point (
stroke.points via ElementDataAccessor.setRange) + maxY, in EMR coords (convert pixel delta with PointUtils.androidPoint2Emr).
- Geometry / TextBox / Picture / Title / FiveStar: shift pixel fields (
points, textRect, rect, Y, etc.). Title also moves its controlTrailNums strokes.
Then modifyElements + PluginNoteAPI.saveCurrentNote + PluginCommAPI.reloadFile.
Goal
Drag on the overlay → compute cutY + delta → shift every element with y > cutY by delta → persist. Bidirectional (down = add space, up = remove space).
Approach (incremental)
- Read elements:
PluginFileAPI.getElements(page, path).
- Filter elements below
cutY.
- Per type, shift position fields (pixel) and, for strokes, EMR points via
setRange + maxY.
modifyElements(path, page, changed) → saveCurrentNote() → reloadFile().
- Heavy performance test on a dense page (many stroke points = many native round-trips).
Acceptance criteria
References
references/make-space.md §10 (out of scope of v1)
references/types.md, references/api-quick-ref.md (element fields, modifyElements)
- SKILL.md "Coordinate Systems", "Element & ElementDataAccessor"
Context
v1 hands off to the native lasso so the user drags manually. The OneNote-style target is a single gesture: drag down and everything below the line shifts automatically by the drag delta — no manual lasso drag.
Why this is hard (the core of v2)
The SDK has no "move selection" API (
resizeLassoRect= proportional scale only). Auto-move must rewrite each element's position by hand:stroke.pointsviaElementDataAccessor.setRange) +maxY, in EMR coords (convert pixel delta withPointUtils.androidPoint2Emr).points,textRect,rect,Y, etc.). Title also moves itscontrolTrailNumsstrokes.Then
modifyElements+PluginNoteAPI.saveCurrentNote+PluginCommAPI.reloadFile.Goal
Drag on the overlay → compute
cutY+delta→ shift every element withy > cutYbydelta→ persist. Bidirectional (down = add space, up = remove space).Approach (incremental)
PluginFileAPI.getElements(page, path).cutY.setRange+maxY.modifyElements(path, page, changed)→saveCurrentNote()→reloadFile().Acceptance criteria
References
references/make-space.md§10 (out of scope of v1)references/types.md,references/api-quick-ref.md(element fields, modifyElements)