diff --git a/src/panels/foldhaus_panel_animation_timeline.h b/src/panels/foldhaus_panel_animation_timeline.h index 9da1f78..f148ffb 100644 --- a/src/panels/foldhaus_panel_animation_timeline.h +++ b/src/panels/foldhaus_panel_animation_timeline.h @@ -485,6 +485,7 @@ DrawAnimationTimeline (animation_system* AnimationSystem, animation_timeline_sta // Animation Blocks b32 MouseDownAndNotHandled = MouseButtonTransitionedDown(Mouse.LeftButtonState); + gs_list_handle DragBlockHandle = {0}; for (u32 i = 0; i < AnimationSystem->Blocks.Used; i++) { gs_list_entry* AnimationBlockEntry = AnimationSystem->Blocks.GetEntryAtIndex(i); @@ -508,15 +509,19 @@ DrawAnimationTimeline (animation_system* AnimationSystem, animation_timeline_sta BlockColor = PinkV4; } rect BlockBounds = DrawAnimationBlock(AnimationBlockAt, BlockColor, AdjustedViewRange, TimelineBounds, RenderBuffer); - if (PointIsInRange(Mouse.Pos, BlockBounds.Min, BlockBounds.Max) - && MouseButtonTransitionedDown(Mouse.LeftButtonState)) + if (PointIsInRange(Mouse.Pos, BlockBounds.Min, BlockBounds.Max)) { - MouseDownAndNotHandled = false; - SelectAndBeginDragAnimationBlock(CurrentBlockHandle, AdjustedViewRange, TimelineBounds, State); + DragBlockHandle = CurrentBlockHandle; } } } + if (MouseDownAndNotHandled && ListHandleIsValid(DragBlockHandle)) + { + MouseDownAndNotHandled = false; + SelectAndBeginDragAnimationBlock(DragBlockHandle, AdjustedViewRange, TimelineBounds, State); + } + // Time Slider if (FrameIsInRange(AnimationSystem->CurrentFrame, AdjustedViewRange)) { diff --git a/todo.txt b/todo.txt index 9cc8e05..8811130 100644 --- a/todo.txt +++ b/todo.txt @@ -78,7 +78,7 @@ Ground Up Reengineering x display more than one layer x add/remove layers - layer masks by sculpture - - blend modes - create a copy of the led's per layer, handle blending outside of patterns + x blend modes - create a copy of the led's per layer, handle blending outside of patterns - interface for animation system - add/remove layers - select blend modes