MCPcopy Create free account
hub / github.com/SplootCode/splootcode / addMarginToLine

Method addMarginToLine

packages/editor/src/context/cursor_map.ts:45–57  ·  view source on GitHub ↗
(y: number, marginTop: number)

Source from the content-addressed store, hash-verified

43 }
44
45 addMarginToLine(y: number, marginTop: number) {
46 let lineMap: Line
47 if (y + marginTop in this.linesIndex) {
48 lineMap = this.linesIndex[y + marginTop]
49 lineMap.yCoord = y
50 lineMap.marginTop = Math.max(lineMap.marginTop, marginTop)
51 this.linesIndex[y] = lineMap
52 } else if (y in this.linesIndex) {
53 lineMap = this.linesIndex[y]
54 lineMap.marginTop = Math.max(lineMap.marginTop, marginTop)
55 this.linesIndex[y + marginTop] = lineMap
56 }
57 }
58
59 registerNodeStart(nodeCursor: NodeCursor, x: number, y: number) {
60 // Check if this is a new line

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected