Remove int v2 type, change V2i to cast i32 to f32
Mixing and matching V2 int and float types in the code creates too much necessary work when an integer implementation has to interact with float implementation. Let V2i create the cast for us and use floats for all vector operations since they are mostly mathematic.
This commit is contained in:
+1
-1
@@ -184,7 +184,7 @@ void renderer_string(Renderer *const renderer, v4 cameraBounds,
|
||||
// NOTE(doyle): Atlas packs fonts tightly, so offset the codepoint
|
||||
// to its actual atlas index, i.e. we skip the first 31 glyphs
|
||||
i32 codepoint = string[i];
|
||||
i32 relativeIndex = codepoint - font->codepointRange.x;
|
||||
i32 relativeIndex = CAST(i32)(codepoint - font->codepointRange.x);
|
||||
CharMetrics charMetric = font->charMetrics[relativeIndex];
|
||||
pos.y = baseline - (scale * charMetric.offset.y);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user