MCPcopy Index your code
hub / github.com/SplootCode/splootcode / constructor

Method constructor

packages/editor/src/layout/rendered_node.ts:117–178  ·  view source on GitHub ↗
(parentListBlock: RenderedChildSetBlock, node: SplootNode, selection: NodeSelection, index: number)

Source from the content-addressed store, hash-verified

115 editCoordinates: [number, number]
116
117 constructor(parentListBlock: RenderedChildSetBlock, node: SplootNode, selection: NodeSelection, index: number) {
118 this.parentChildSet = parentListBlock
119 this.selection = selection
120 this.index = index
121 this.renderedChildSets = {}
122 this.childSetOrder = []
123 this.layout = node.getNodeLayout()
124 this.textColor = getColor(this.layout.color, ColorUsageType.NODE_TEXT)
125 this.capColor = getColor(this.layout.color, ColorUsageType.CAP_TEXT)
126 this.nodeFillColor = getColor(this.layout.color, ColorUsageType.NODE_FILL)
127 this.capFillColor = getColor(this.layout.color, ColorUsageType.CAP_FILL)
128 this.node = node
129 this.leftCurve = false
130 this.rightCurve = false
131 this.isValid = node.isValid
132 this.invalidReason = node.invalidReason
133 this.invalidChildsetID = node.invalidChildSetID
134 this.invalidChildsetIndex = node.invalidChildIndex
135 this.runtimeAnnotations = []
136 if (selection) {
137 // Using selection as a proxy for whether this is a real node or a autcomplete
138 this.node.registerObserver(this)
139 }
140 this.renderedInlineComponents = []
141 this.blockWidth = 0
142 this.marginLeft = 0
143 this.width = 0
144 this.editCoordinates = [0, 0]
145
146 this.rowHeight = NODE_BLOCK_HEIGHT
147 this.indentedBlockHeight = 0
148 this.beforeStackHeight = 0
149 this.rightAttachedChildSet = null
150 this.leftBreadcrumbChildSet = null
151 this.beforeStackChildSet = null
152
153 this.layout.components.forEach((component: LayoutComponent, idx: number) => {
154 if (
155 component.type === LayoutComponentType.CHILD_SET_BLOCK ||
156 component.type === LayoutComponentType.CHILD_SET_TREE_BRACKETS ||
157 component.type === LayoutComponentType.CHILD_SET_TREE ||
158 component.type === LayoutComponentType.CHILD_SET_TOKEN_LIST ||
159 component.type === LayoutComponentType.CHILD_SET_ATTACH_RIGHT ||
160 component.type === LayoutComponentType.CHILD_SET_BREADCRUMBS ||
161 component.type === LayoutComponentType.CHILD_SET_STACK ||
162 component.type === LayoutComponentType.CHILD_SET_BEFORE_STACK
163 ) {
164 const childSet = node.getChildSet(component.identifier)
165 this.childSetOrder.push(component.identifier)
166 const childSetParentRef = new RenderedParentRef(this, component.identifier)
167 const renderedChildSet = new RenderedChildSetBlock(childSetParentRef, selection, childSet, component)
168 this.renderedChildSets[component.identifier] = renderedChildSet
169 if (component.type === LayoutComponentType.CHILD_SET_ATTACH_RIGHT) {
170 this.rightAttachedChildSet = component.identifier
171 } else if (component.type === LayoutComponentType.CHILD_SET_BREADCRUMBS) {
172 this.leftBreadcrumbChildSet = component.identifier
173 } else if (component.type === LayoutComponentType.CHILD_SET_BEFORE_STACK) {
174 this.beforeStackChildSet = component.identifier

Callers

nothing calls this directly

Calls 4

getColorFunction · 0.90
getNodeLayoutMethod · 0.45
registerObserverMethod · 0.45
getChildSetMethod · 0.45

Tested by

no test coverage detected