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
b32 MouseDownAndNotHandled = MouseButtonTransitionedDown(Mouse.LeftButtonState);
gs_list_handle DragBlockHandle = {0};
for (u32 i = 0; i < AnimationSystem->Blocks.Used; i++)
{
gs_list_entry<animation_block>* AnimationBlockEntry = AnimationSystem->Blocks.GetEntryAtIndex(i);
@ -508,13 +509,17 @@ 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))
{
DragBlockHandle = CurrentBlockHandle;
}
}
}
if (MouseDownAndNotHandled && ListHandleIsValid(DragBlockHandle))
{
MouseDownAndNotHandled = false;
SelectAndBeginDragAnimationBlock(CurrentBlockHandle, AdjustedViewRange, TimelineBounds, State);
}
}
SelectAndBeginDragAnimationBlock(DragBlockHandle, AdjustedViewRange, TimelineBounds, State);
}
// Time Slider

View File

@ -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