From b99332f721590c374230300ff9cdf133d676f693 Mon Sep 17 00:00:00 2001 From: Senne De Vocht Date: Tue, 10 Dec 2024 19:18:04 +0100 Subject: [PATCH] Added lerping for all variants of Val (#127) --- src/lens.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lens.rs b/src/lens.rs index 5b13788..63ef498 100644 --- a/src/lens.rs +++ b/src/lens.rs @@ -298,6 +298,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, } }