Skip to content

Commit

Permalink
ui: Fix relative offset issues in Stack
Browse files Browse the repository at this point in the history
  • Loading branch information
marekmaskarinec committed Jan 25, 2024
1 parent 24cd48b commit 19895c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/staembed.c
Original file line number Diff line number Diff line change
Expand Up @@ -3584,8 +3584,8 @@ const char *th_em_modulesrc[] = {
"//~~\n"
"\n"
"fn (this: ^Stack) pushRect(r: rect.Rect): rect.Rect {\n"
"\tif r.x == 0 { r.x = this.dm.x + this.cfg.padding }\n"
"\tif r.y == 0 { r.y = this.dm.y + this.cfg.padding }\n"
"\tr.x += this.dm.x + this.cfg.padding\n"
"\tr.y += this.dm.y + this.cfg.padding\n"
"\tif r.w == 0 { r.w = this.dm.w - 2*this.cfg.padding }\n"
"\tif r.h == 0 { r.h = this.dm.h - 2*this.cfg.padding }\n"
"\n"
Expand Down
4 changes: 2 additions & 2 deletions umka/ui.um
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ type Stack* = struct {
//~~

fn (this: ^Stack) pushRect(r: rect.Rect): rect.Rect {
if r.x == 0 { r.x = this.dm.x + this.cfg.padding }
if r.y == 0 { r.y = this.dm.y + this.cfg.padding }
r.x += this.dm.x + this.cfg.padding
r.y += this.dm.y + this.cfg.padding
if r.w == 0 { r.w = this.dm.w - 2*this.cfg.padding }
if r.h == 0 { r.h = this.dm.h - 2*this.cfg.padding }

Expand Down

0 comments on commit 19895c8

Please sign in to comment.