Handle negative glyph positions correctly

This commit is contained in:
grovesNL 2022-11-29 14:33:12 -03:30
parent ca27ec508c
commit 2a01a1b2e0
4 changed files with 19 additions and 19 deletions

View file

@ -1,6 +1,6 @@
struct VertexInput {
@builtin(vertex_index) vertex_idx: u32,
@location(0) pos: vec2<u32>,
@location(0) pos: vec2<i32>,
@location(1) dim: u32,
@location(2) uv: u32,
@location(3) color: u32,
@ -37,17 +37,17 @@ fn vs_main(in_vert: VertexInput) -> VertexOutput {
switch v {
case 1u: {
pos.x += width;
pos.x += i32(width);
uv.x += width;
}
case 2u: {
pos.x += width;
pos.y += height;
pos.x += i32(width);
pos.y += i32(height);
uv.x += width;
uv.y += height;
}
case 3u: {
pos.y += height;
pos.y += i32(height);
uv.y += height;
}
default: {}