Skip to content

Commit

Permalink
fix: xy when has parent
Browse files Browse the repository at this point in the history
  • Loading branch information
levovix0 committed Aug 17, 2022
1 parent 742a1f2 commit 0eb4f24
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/boxes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,15 @@ proc makeBox(args: seq[NimNode]): NimNode =
identDefs:
xs
empty()
call ident"float32", dotExpr(ident"xy", ident"x")
call bindSym"+":
dotExpr(ident"box", ident"x")
call ident"float32", dotExpr(ident"xy", ident"x")
identDefs:
ys
empty()
call ident"float32", dotExpr(ident"xy", ident"y")
call bindSym"+":
dotExpr(ident"box", ident"y")
call ident"float32", dotExpr(ident"xy", ident"y")

if "wh" in d:
letSection:
Expand All @@ -144,14 +148,18 @@ proc makeBox(args: seq[NimNode]): NimNode =
identDefs:
xs
empty()
d["x"].getX
call bindSym"+":
dotExpr(ident"box", ident"x")
d["x"].getX

if "y" in d:
letSection:
identDefs:
ys
empty()
d["y"].getY
call bindSym"+":
dotExpr(ident"box", ident"y")
d["y"].getY

if "w" in d:
letSection:
Expand Down

0 comments on commit 0eb4f24

Please sign in to comment.