From d725398bd10ad4bb18f3ced1800a3cf337009b41 Mon Sep 17 00:00:00 2001 From: Senne De Vocht Date: Wed, 19 Jun 2024 20:56:40 +0200 Subject: [PATCH] Added lerping for all variants of Val --- src/lens.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lens.rs b/src/lens.rs index 227d94e..1bf707e 100644 --- a/src/lens.rs +++ b/src/lens.rs @@ -310,6 +310,10 @@ fn lerp_val(start: &Val, end: &Val, ratio: f32) -> Val { Val::Percent((end - start).mul_add(ratio, *start)) } (Val::Px(start), Val::Px(end)) => Val::Px((end - start).mul_add(ratio, *start)), + (Val::Vw(start), Val::Vw(end)) => Val::Vw((end - start).mul_add(ratio, *start)), + (Val::Vh(start), Val::Vh(end)) => Val::Vh((end - start).mul_add(ratio, *start)), + (Val::VMin(start), Val::VMin(end)) => Val::VMin((end - start).mul_add(ratio, *start)), + (Val::VMax(start), Val::VMax(end)) => Val::VMax((end - start).mul_add(ratio, *start)), _ => *start, } }