Minor fixes

This commit is contained in:
Synthasmagoria 2026-08-26 00:43:22 +02:00
commit dbdd0e9bab
5 changed files with 75 additions and 35 deletions

View file

@ -40,6 +40,15 @@ rectangle_corners_lerp :: proc "contextless" (a, b: RectangleCorners, t: f32) ->
}
}
rectangle_corners_add :: proc "contextless" (corners: RectangleCorners, translation: v2) -> RectangleCorners {
return {
corners.tl + translation,
corners.tr + translation,
corners.br + translation,
corners.bl + translation,
}
}
rectangle_corners_move_corner :: proc "contextless" (corners: RectangleCorners, position: v2, corner: RectangleCornersCorner) -> RectangleCorners {
corners := corners
switch corner {
@ -147,6 +156,10 @@ animation_is_finished :: proc(animation: Animation) -> bool {
return animation.matrix_index == f32(animation.matrix_count)
}
animation_get_eased_progress :: proc(animation: Animation) -> f32 {
return math.floor(animation.matrix_index) + ease.ease(animation.ease, fract(animation.matrix_index))
}
animation_draw :: proc(animation: Animation, global_transform: mat3) {
switch animation.type {
case .Rectangle: