~mrms/tophat

19895c8f94c7695d7bb2b2c96f7b3c62f5f86846 — Marek Ma┼íkarinec 3 months ago 24cd48b
ui: Fix relative offset issues in Stack
2 files changed, 4 insertions(+), 4 deletions(-)

M src/staembed.c
M umka/ui.um
M src/staembed.c => src/staembed.c +2 -2
@@ 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"

M umka/ui.um => umka/ui.um +2 -2
@@ 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 }