Fixed problem where overlapping animation clips would trigger multiple drag animation block commands.

This commit is contained in:
Peter Slattery 2020-03-08 14:57:34 -07:00
parent d5309819e6
commit 2fbc916c79
2 changed files with 10 additions and 5 deletions

View File

@ -485,6 +485,7 @@ DrawAnimationTimeline (animation_system* AnimationSystem, animation_timeline_sta
// Animation Blocks // Animation Blocks
b32 MouseDownAndNotHandled = MouseButtonTransitionedDown(Mouse.LeftButtonState); b32 MouseDownAndNotHandled = MouseButtonTransitionedDown(Mouse.LeftButtonState);
gs_list_handle DragBlockHandle = {0};
for (u32 i = 0; i < AnimationSystem->Blocks.Used; i++) for (u32 i = 0; i < AnimationSystem->Blocks.Used; i++)
{ {
gs_list_entry<animation_block>* AnimationBlockEntry = AnimationSystem->Blocks.GetEntryAtIndex(i); gs_list_entry<animation_block>* AnimationBlockEntry = AnimationSystem->Blocks.GetEntryAtIndex(i);
@ -508,15 +509,19 @@ DrawAnimationTimeline (animation_system* AnimationSystem, animation_timeline_sta
BlockColor = PinkV4; BlockColor = PinkV4;
} }
rect BlockBounds = DrawAnimationBlock(AnimationBlockAt, BlockColor, AdjustedViewRange, TimelineBounds, RenderBuffer); rect BlockBounds = DrawAnimationBlock(AnimationBlockAt, BlockColor, AdjustedViewRange, TimelineBounds, RenderBuffer);
if (PointIsInRange(Mouse.Pos, BlockBounds.Min, BlockBounds.Max) if (PointIsInRange(Mouse.Pos, BlockBounds.Min, BlockBounds.Max))
&& MouseButtonTransitionedDown(Mouse.LeftButtonState))
{ {
MouseDownAndNotHandled = false; DragBlockHandle = CurrentBlockHandle;
SelectAndBeginDragAnimationBlock(CurrentBlockHandle, AdjustedViewRange, TimelineBounds, State);
} }
} }
} }
if (MouseDownAndNotHandled && ListHandleIsValid(DragBlockHandle))
{
MouseDownAndNotHandled = false;
SelectAndBeginDragAnimationBlock(DragBlockHandle, AdjustedViewRange, TimelineBounds, State);
}
// Time Slider // Time Slider
if (FrameIsInRange(AnimationSystem->CurrentFrame, AdjustedViewRange)) if (FrameIsInRange(AnimationSystem->CurrentFrame, AdjustedViewRange))
{ {

View File

@ -78,7 +78,7 @@ Ground Up Reengineering
x display more than one layer x display more than one layer
x add/remove layers x add/remove layers
- layer masks by sculpture - 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 - interface for animation system
- add/remove layers - add/remove layers
- select blend modes - select blend modes