From edd12d505d5dd1a5199596d52d17a0011e8f83dc Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 3 Nov 2021 11:20:04 +0000 Subject: [PATCH] Correct fmt for matrices --- core/fmt/fmt.odin | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 2cf032b73..21aa1efcf 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -1934,7 +1934,7 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) { for col in 0.. 0 { io.write_string(fi.writer, ", ") } - offset := (row + col*info.elem_stride)*info.elem_size + offset := (col + row*info.elem_stride)*info.elem_size data := uintptr(v.data) + uintptr(offset) fmt_arg(fi, any{rawptr(data), info.elem.id}, verb) @@ -1943,11 +1943,11 @@ fmt_value :: proc(fi: ^Info, v: any, verb: rune) { } } else { for row in 0.. 0 { io.write_string(fi.writer, ", ") } + if row > 0 { io.write_string(fi.writer, "; ") } for col in 0.. 0 { io.write_string(fi.writer, "; ") } + if col > 0 { io.write_string(fi.writer, ", ") } - offset := (row + col*info.elem_stride)*info.elem_size + offset := (col + row*info.elem_stride)*info.elem_size data := uintptr(v.data) + uintptr(offset) fmt_arg(fi, any{rawptr(data), info.elem.id}, verb)