~mrms/proped

51dc64f0bd0e5a93584c18089beee8b8e73b8498 — Marek Maškarinec 2 months ago bc5d8ec
fix sprintf
M proped.um => proped.um +2 -2
@@ 188,7 188,7 @@ fn drawHeader*(r: rect.Rect) {

	p.x += 50*gui.uiscale
	for i in stack {
		t := std.sprintf(" » %s: %s", stack[i].name, stack[i].typeName)
		t := sprintf(" » %s: %s", stack[i].name, stack[i].typeName)
		m := gui.ft.measure(t).mulf(gui.uiscale)
		gui.ft.draw(t, th.Vf2{p.x, p.y + (r.h-m.y)/2}, th.white, gui.uiscale)
		p.x += m.x + gui.padding*gui.uiscale


@@ 379,7 379,7 @@ fn drawStatus*(limit: rect.Rect) {
		snapStr = "enabled"
	}

	t := std.sprintf("zoom: %f\nsnap %s (%f)", zoom, snapStr, snap)
	t := sprintf("zoom: %f\nsnap %s (%f)", zoom, snapStr, snap)
	m := gui.ft.measure(t).mulf(gui.uiscale)

	p := th.Vf2{

M thdefs/proped_color.um => thdefs/proped_color.um +1 -1
@@ 45,6 45,6 @@ fn drawFn*(r: rect.Rect, v: ^proped.Value): rect.Rect {
fn exportFn*(t: proped.ExportTarget, v: proped.Value): str {
	c := fromValue(v)

	return std.sprintf("0x%x", c)
	return sprintf("0x%x", c)
}


M thdefs/proped_image.um => thdefs/proped_image.um +1 -1
@@ 94,5 94,5 @@ fn drawFn*(r: rect.Rect, v: ^proped.Value): rect.Rect {
}

fn exportFn*(t: proped.ExportTarget, v: proped.Value): str {
	return std.sprintf("image.load(\"%s\")", str(v.fields["path"]))
	return sprintf("image.load(\"%s\")", str(v.fields["path"]))
}

M thdefs/proped_rect.um => thdefs/proped_rect.um +1 -1
@@ 62,6 62,6 @@ fn drawFn*(r: rect.Rect, v: ^proped.Value): rect.Rect {

fn exportFn*(t: proped.ExportTarget, v: proped.Value): str {
	r := fromValue(v)
	return std.sprintf("rect.Rect{%f, %f, %f, %f}", r.x, r.y, r.w, r.h)
	return sprintf("rect.Rect{%f, %f, %f, %f}", r.x, r.y, r.w, r.h)
}


M thdefs/proped_transform.um => thdefs/proped_transform.um +1 -1
@@ 36,7 36,7 @@ fn drawFn*(r: rect.Rect, v: ^proped.Value): rect.Rect {
}

fn exportFn*(t: proped.ExportTarget, v: proped.Value): str {
	return std.sprintf("th.Transform{%s, %s, %s, %s}",
	return sprintf("th.Transform{%s, %s, %s, %s}",
		proped_vf2.exportFn(t, proped.Value(v.fields["p"])),
		proped_vf2.exportFn(t, proped.Value(v.fields["s"])),
		proped_vf2.exportFn(t, proped.Value(v.fields["o"])),

M thdefs/proped_vf2.um => thdefs/proped_vf2.um +1 -1
@@ 37,5 37,5 @@ fn drawFn*(r: rect.Rect, v: ^proped.Value): rect.Rect {

fn exportFn*(t: proped.ExportTarget, v: proped.Value): str {
	f := fromValue(v)
	return std.sprintf("th.Vf2{%f, %f}", f.x, f.y)
	return sprintf("th.Vf2{%f, %f}", f.x, f.y)
}