Ejemplo n.º 1
0
            private void updateDragBoxPosition()
            {
                if (selectionStart == null)
                {
                    return;
                }

                float rescaledStart = selectionStart.Value * timeline.CurrentZoom;
                float rescaledEnd   = selectionEnd * timeline.CurrentZoom;

                Box.X     = Math.Min(rescaledStart, rescaledEnd);
                Box.Width = Math.Abs(rescaledStart - rescaledEnd);

                PerformSelection?.Invoke(Box.ScreenSpaceDrawQuad.AABBFloat);
            }
Ejemplo n.º 2
0
            public override bool HandleDrag(MouseButtonEvent e)
            {
                // store the original position of the mouse down, as we may be scrolled during selection.
                if (lastMouseDown != e.ScreenSpaceMouseDownPosition)
                {
                    lastMouseDown  = e.ScreenSpaceMouseDownPosition;
                    localMouseDown = e.MouseDownPosition.X;
                }

                float selection1 = localMouseDown;
                float selection2 = e.MousePosition.X;

                Box.X     = Math.Min(selection1, selection2);
                Box.Width = Math.Abs(selection1 - selection2);

                PerformSelection?.Invoke(Box.ScreenSpaceDrawQuad.AABBFloat);
                return(true);
            }
            private void updateDragBoxPosition()
            {
                if (selectionStart == null)
                {
                    return;
                }

                float rescaledStart = selectionStart.Value * editor.CurrentZoom;
                float rescaledEnd   = selectionEnd * editor.CurrentZoom;

                Box.X     = Math.Min(rescaledStart, rescaledEnd);
                Box.Width = Math.Abs(rescaledStart - rescaledEnd);

                var boxScreenRect = Box.ScreenSpaceDrawQuad.AABBFloat;

                // we don't care about where the hitobjects are vertically. in cases like stacking display, they may be outside the box without this adjustment.
                boxScreenRect.Y      -= boxScreenRect.Height;
                boxScreenRect.Height *= 2;

                PerformSelection?.Invoke(boxScreenRect);
            }