git.lucas.co / cce-gallery
widget gallery and compositor test bench

commit88da973a677ad01f578619396a75868059898e07
parentf0f4126d35
authorLucas Galante <[email protected]>
date2026-07-11 22:46
chore: Ramp/ColorRamp -> Adapted (cce-ui Phase 6as); child-ramp downcast via as_any

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018u7qTwzX95dd5ysAkaSCLk

 src/main.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index df1c60f..66c2075 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -589,7 +589,7 @@ cascades in cce."
             state.widgets[2].add_child(dropdown_ptr, &mut state.ui_context);
         } else {
             state.focused_widget = Some(1);
-            let ramp = unsafe { &mut *(state.widgets[1].as_ptr_mut() as *mut Ramp) };
+            let ramp = state.widgets[1].as_any_mut().downcast_mut::<Ramp>().expect("child ramp widget");
             let preset_ptr = ramp.preset_dropdown.as_ptr_mut();
             state.ui_context.set_focused_ptr(preset_ptr);
             unsafe {