diff options
author | Marvin Borner | 2021-07-01 14:43:53 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-01 14:43:53 +0200 |
commit | 340e841772eb13d9087235b8707c1cfeff8710cb (patch) | |
tree | 5f4c3328105a3ab194deef9f05fd05ff3c26b7dc /libs/libgui/gfx.c | |
parent | 73a7db5b48eab615a0f6258e0196a1260a88cbbb (diff) |
Math improvements and basic plotting
Diffstat (limited to 'libs/libgui/gfx.c')
-rw-r--r-- | libs/libgui/gfx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/libgui/gfx.c b/libs/libgui/gfx.c index 913fe59..8f6f163 100644 --- a/libs/libgui/gfx.c +++ b/libs/libgui/gfx.c @@ -305,8 +305,8 @@ struct gfx_context *gfx_scale(struct gfx_context *ctx, vec2 size) y++; } - f32 gx = x / (f32)size.x * (ctx->size.x - 1); - f32 gy = y / (f32)size.y * (ctx->size.y - 1); + f64 gx = x / (f64)size.x * (ctx->size.x - 1); + f64 gy = y / (f64)size.y * (ctx->size.y - 1); u32 gxi = (u32)gx; u32 gyi = (u32)gy; @@ -317,7 +317,7 @@ struct gfx_context *gfx_scale(struct gfx_context *ctx, vec2 size) u32 color = 0; for (u8 i = 0; i < bypp; i++) { - color |= ((u32)blerpf(GET_COLOR(a, i), GET_COLOR(b, i), GET_COLOR(c, i), + color |= ((u32)mblerp(GET_COLOR(a, i), GET_COLOR(b, i), GET_COLOR(c, i), GET_COLOR(d, i), gx - gxi, gy - gyi)) << (i << 3); } |