rename to timestep_alpha

This commit is contained in:
Aleksander
2025-11-13 20:23:27 +01:00
parent 1b0ebb8414
commit 4d4292255a
3 changed files with 10 additions and 10 deletions

View File

@@ -344,7 +344,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
globals: &mut globals,
layout: &mut layout,
debug_draw: debug_draw_enabled,
alpha: timestep.alpha,
timestep_alpha: timestep.alpha,
};
let primitives = wgui::drawing::draw(&mut draw_params).unwrap();

View File

@@ -9,7 +9,7 @@ use crate::{
event::EventAlterables,
globals::Globals,
layout::Widget,
renderer_vk::text::{custom_glyph::CustomGlyph, TextShadow},
renderer_vk::text::{TextShadow, custom_glyph::CustomGlyph},
stack::{self, ScissorBoundary, ScissorStack, TransformStack},
widget::{self, ScrollbarInfo, WidgetState},
};
@@ -173,7 +173,7 @@ pub struct DrawParams<'a> {
pub globals: &'a Globals,
pub layout: &'a mut Layout,
pub debug_draw: bool,
pub alpha: f32, // timestep alpha, 0.0 - 1.0, used for motion interpolation if rendering above tick rate: smoother animations or scrolling
pub timestep_alpha: f32, // timestep alpha, 0.0 - 1.0, used for motion interpolation if rendering above tick rate: smoother animations or scrolling
}
pub fn has_overflow_clip(style: &taffy::Style) -> bool {
@@ -250,7 +250,7 @@ fn draw_widget(
let (scroll_shift, wants_redraw, info) = match widget::get_scrollbar_info(l) {
Some(info) => {
let (scrolling, wants_redraw) = widget_state.get_scroll_shift_smooth(&info, l, params.alpha);
let (scrolling, wants_redraw) = widget_state.get_scroll_shift_smooth(&info, l, params.timestep_alpha);
(scrolling, wants_redraw, Some(info))
}
None => (Vec2::default(), false, None),
@@ -264,7 +264,7 @@ fn draw_widget(
state.primitives.push(primitive_debug_rect(
&boundary,
&state.transform_stack.get().transform,
Color::new(0.0, 1.0, 1.0, 0.5 * params.alpha),
Color::new(0.0, 1.0, 1.0, 0.5),
));
}
@@ -277,7 +277,7 @@ fn draw_widget(
state.primitives.push(primitive_debug_rect(
&boundary_relative,
&state.transform_stack.get().transform,
Color::new(1.0, 0.0, 1.0, params.alpha),
Color::new(1.0, 0.0, 1.0, 1.0),
));
}

View File

@@ -1,7 +1,7 @@
use std::{cell::RefCell, rc::Rc};
use button::setup_custom_button;
use glam::{vec2, Affine2, Vec2};
use glam::{Affine2, Vec2, vec2};
use label::setup_custom_label;
use wgui::{
assets::AssetPath,
@@ -16,14 +16,14 @@ use wgui::{
layout::{Layout, LayoutParams, WidgetID},
parser::{CustomAttribsInfoOwned, ParserState},
renderer_vk::context::Context as WguiContext,
widget::{label::WidgetLabel, rectangle::WidgetRectangle, EventResult},
widget::{EventResult, label::WidgetLabel, rectangle::WidgetRectangle},
};
use crate::{
backend::input::{Haptics, HoverResult, PointerHit, PointerMode},
state::AppState,
subsystem::hid::WheelDelta,
windowing::backend::{ui_transform, FrameMeta, OverlayBackend, RenderResources, ShouldRender},
windowing::backend::{FrameMeta, OverlayBackend, RenderResources, ShouldRender, ui_transform},
};
use super::{timer::GuiTimer, timestep::Timestep};
@@ -289,7 +289,7 @@ impl<S: 'static> OverlayBackend for GuiPanel<S> {
globals: &mut globals,
layout: &mut self.layout,
debug_draw: false,
alpha: self.timestep.alpha,
timestep_alpha: self.timestep.alpha,
})?;
self.context.draw(
&globals.font_system,