gfx: integrate new font stack into Text module
Helps hexops/mach#877 Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
34259ed1b8
commit
1f8962408c
4 changed files with 66 additions and 104 deletions
|
|
@ -362,15 +362,13 @@ pub fn Mat(
|
|||
|
||||
/// Matrix * Vector multiplication
|
||||
pub inline fn mulVec(a: *const Matrix, b: *const ColVec) ColVec {
|
||||
var result = [_]ColVec.T{0}**ColVec.n;
|
||||
var result = [_]ColVec.T{0} ** ColVec.n;
|
||||
inline for (0..Matrix.rows) |row| {
|
||||
inline for (0..ColVec.n) |i| {
|
||||
result[i] += a.v[row].v[i] * b.v[row];
|
||||
}
|
||||
}
|
||||
return vec.Vec(ColVec.n, ColVec.T){
|
||||
.v = result
|
||||
};
|
||||
return vec.Vec(ColVec.n, ColVec.T){ .v = result };
|
||||
}
|
||||
|
||||
// TODO: the below code was correct in our old implementation, it just needs to be updated
|
||||
|
|
@ -671,7 +669,7 @@ test "Mat3x3_mulVec_vec3" {
|
|||
);
|
||||
|
||||
const m = math.Mat3x3.mulVec(&mat, &v);
|
||||
const expected = math.vec3(2,2,3);
|
||||
const expected = math.vec3(2, 2, 3);
|
||||
try testing.expect(math.Vec3, expected).eql(m);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue