- Move scene graph behavior tests into focused files - Share basic scene graph helper builders from basic/helpers.ts - Remove scene graph basic from max-lines exceptions
9 lines
313 B
TypeScript
9 lines
313 B
TypeScript
import type { SceneGraph } from '@open-pencil/core'
|
|
export function pageId(graph: SceneGraph) {
|
|
return graph.getPages()[0].id
|
|
}
|
|
|
|
export function rect(graph: SceneGraph, name: string, x = 0, y = 0, w = 50, h = 50) {
|
|
return graph.createNode('RECTANGLE', pageId(graph), { name, x, y, width: w, height: h }).id
|
|
}
|