MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / scrollbar_visibility_alpha

Function scrollbar_visibility_alpha

src/engine.rs:877–892  ·  view source on GitHub ↗
(config: ScrollbarConfig, idle_frames: u32)

Source from the content-addressed store, hash-verified

875}
876
877fn scrollbar_visibility_alpha(config: ScrollbarConfig, idle_frames: u32) -> f32 {
878 match config.hide_after_frames {
879 None => 1.0,
880 Some(hide) => {
881 if hide == 0 {
882 return 0.0;
883 }
884 if idle_frames <= hide {
885 return 1.0;
886 }
887 let fade_frames = ((hide as f32) * 0.25).ceil().max(1.0) as u32;
888 let fade_progress = (idle_frames - hide) as f32 / fade_frames as f32;
889 (1.0 - fade_progress).clamp(0.0, 1.0)
890 }
891 }
892}
893
894fn apply_alpha(color: Color, alpha_mul: f32) -> Color {
895 Color::rgba(

Calls

no outgoing calls

Tested by

no test coverage detected