From 2081febd82736c74d26f5ccb4dbe68c057b0a9e9 Mon Sep 17 00:00:00 2001 From: Orchaldir Date: Sun, 17 Sep 2023 09:56:47 +0200 Subject: [PATCH] [#41] Refactor --- rpg_tools_rendering/src/rendering/equipment/pants.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/rpg_tools_rendering/src/rendering/equipment/pants.rs b/rpg_tools_rendering/src/rendering/equipment/pants.rs index 40e074d8..e18fb44e 100644 --- a/rpg_tools_rendering/src/rendering/equipment/pants.rs +++ b/rpg_tools_rendering/src/rendering/equipment/pants.rs @@ -49,14 +49,9 @@ fn get_shorts(config: &RenderConfig, aabb: &AABB, body: &Body) -> Polygon2d { fn get_shorter_pants(config: &RenderConfig, aabb: &AABB, body: &Body, factor: f32) -> Polygon2d { let top_y = config.body.get_torso_bottom(); - let bottom_y = config.pants.get_bottom_y(&config.body, body); - get_pants( - config, - aabb, - body, - interpolate(top_y, bottom_y, factor), - false, - ) + let full_bottom_y = config.pants.get_bottom_y(&config.body, body); + let bottom_y = interpolate(top_y, full_bottom_y, factor); + get_pants(config, aabb, body, bottom_y, false) } fn get_pants(