Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
elcritch committed Nov 12, 2023
1 parent e67bdec commit 18bbec2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions figuro/ui/core.nim
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,6 @@ proc postNode*(node: var Figuro) =

import utils, macros, typetraits

template preDrawBody(widgetType, blk: untyped) =
let node {.inject.} = `widgetType`(c)
if preDrawReady in node.attrs:
node.attrs.excl preDrawReady
`blk`

template setupWidget(
`widgetType`, `kind`, `id`, `hasCaptures`, `hasBinds`, `capturedVals`, `blk`
): auto =
Expand All @@ -263,7 +257,10 @@ template setupWidget(
preNode(`kind`, `id`, node, parent)
wrapCaptures(`hasCaptures`, `capturedVals`):
node.preDraw = proc (c: Figuro) =
preDrawBody(`widgetType`, `blk`)
let node {.inject.} = `widgetType`(c)
if preDrawReady in node.attrs:
node.attrs.excl preDrawReady
`blk`
postNode(Figuro(node))
when `hasBinds`:
node
Expand Down

0 comments on commit 18bbec2

Please sign in to comment.