Skip to content

Commit

Permalink
Rename box variables to bar
Browse files Browse the repository at this point in the history
  • Loading branch information
pleek91 committed Oct 23, 2023
1 parent 495a44a commit 6b09ec5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/factories/nodeFlowRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export async function flowRunContainerFactory(node: RunGraphNode) {

async function render(node: RunGraphNode): Promise<Container> {
const label = await renderLabel(node)
const box = await renderBar(node)
const bar = await renderBar(node)

label.position = getLabelPosition(label, box)
label.position = getLabelPosition(label, bar)

return container
}
Expand All @@ -54,11 +54,11 @@ export async function flowRunContainerFactory(node: RunGraphNode) {
}
}

function getLabelPosition(label: BitmapText, box: Container): Pixels {
function getLabelPosition(label: BitmapText, bar: Container): Pixels {
// todo: this should probably be nodePadding
const margin = config.styles.nodeMargin
const inside = box.width > margin + label.width + margin
const y = box.height / 2 - label.height
const inside = bar.width > margin + label.width + margin
const y = bar.height / 2 - label.height

if (inside) {
return {
Expand All @@ -68,7 +68,7 @@ export async function flowRunContainerFactory(node: RunGraphNode) {
}

return {
x: box.width + margin,
x: bar.width + margin,
y,
}
}
Expand Down

0 comments on commit 6b09ec5

Please sign in to comment.