From 937d12c87b330fce7b8e15955b848802ddac4f36 Mon Sep 17 00:00:00 2001 From: Alula <6276139+alula@users.noreply.github.com> Date: Mon, 21 Jun 2021 13:11:58 +0200 Subject: [PATCH] number popup stuttering fix --- src/components/number_popup.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/number_popup.rs b/src/components/number_popup.rs index 7168f70..bf34036 100644 --- a/src/components/number_popup.rs +++ b/src/components/number_popup.rs @@ -1,4 +1,4 @@ -use crate::common::{fix9_scale, interpolate_fix9_scale, Rect}; +use crate::common::{interpolate_fix9_scale, Rect}; use crate::entity::GameEntity; use crate::frame::Frame; use crate::framework::context::Context; @@ -63,7 +63,7 @@ impl GameEntity<()> for NumberPopup { let (frame_x, frame_y) = frame.xy_interpolated(state.frame_time); let x = interpolate_fix9_scale(self.prev_x, self.x, state.frame_time) - frame_x; - let y = interpolate_fix9_scale(self.prev_x, self.y, state.frame_time) - frame_y - y_offset; + let y = interpolate_fix9_scale(self.prev_y, self.y, state.frame_time) - frame_y - y_offset; let mut n = self.value.to_string(); if self.value > 0 {