예제 #1
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     changeHandler?.BeginChange();
     return(true);
 }
예제 #2
0
 protected override bool OnDragStart(DragStartEvent e) => placementControlPoint != null;
예제 #3
0
        public override bool OnToolDragStart(DragStartEvent e)
        {
            var mousePos          = ToSpaceOfOtherDrawable(ToLocalSpace(e.ScreenSpaceMouseDownPosition), Editor.NotesTimeline.NoteSelectionIndicators);
            var selectedNoteTime  = 0d;
            var selectedNoteCoord = Vector2.Zero;

            foreach (var noteAndTime in NotesTimeline.SelectedNoteToTime)
            {
                var note = noteAndTime.Key;
                var noteToTimelineNote = Editor.NotesTimeline.NoteToTimelineNote;
                if (noteToTimelineNote.TryGetValue(note, out var timelineNote) && IsMouseOnTimelineNote(mousePos, timelineNote))
                {
                    ToDrag     = SelectToolDragState.DragTimelineNote;
                    OldHitTime = selectedNoteTime = note.HitTime;
                    if (note is HoldNote holdNote && IsMouseOnEndOfHoldNote(mousePos, holdNote))
                    {
                        ToDrag              = SelectToolDragState.DragHoldNoteEndTime;
                        OldEndTime          = holdNote.EndTime;
                        OldFirstVisibleTick = NotesTimeline.FirstVisibleTick;
                    }
                    break;
                }
            }
            if (ToDrag == SelectToolDragState.None)
            {
                foreach (var note in GetVisibleStoryNotes())
                {
                    if (IsMouseOnNote(e.ScreenSpaceMousePosition, note))
                    {
                        if (note is HoldNote holdNote)
                        {
                            continue;
                        }                                            // Temp fix to stop dragging holdnote preview
                        ToDrag    = SelectToolDragState.DragNote;
                        OldCoords = selectedNoteCoord = note.Coordinates;
                        break;
                    }
                }
            }

            switch (ToDrag)
            {
            case SelectToolDragState.DragHoldNoteEndTime:
            case SelectToolDragState.DragTimelineNote:
                foreach (var noteAndTime in NotesTimeline.SelectedNoteToTime)
                {
                    var note = noteAndTime.Key;
                    TimelineNoteToDragPointDelta[note] = GetGameTimeAtMouse(e.ScreenSpaceMouseDownPosition) - selectedNoteTime;
                }
                break;

            case SelectToolDragState.DragNote:
                foreach (var noteAndTime in NotesTimeline.SelectedNoteToTime)
                {
                    var note = noteAndTime.Key;
                    NoteToDragPointDelta[note] = note.Coordinates - selectedNoteCoord;
                }
                break;

            case SelectToolDragState.None:
                break;
            }
            return(true);
        }
예제 #4
0
 protected override bool OnDragStart(DragStartEvent e) => CurrentlyDragging = true;
 protected override bool OnDragStart(DragStartEvent e)
 {
     OperationStarted?.Invoke();
     return(true);
 }
예제 #6
0
        protected override bool OnDragStart(DragStartEvent e)
        {
            Vector2 posDiff = e.MouseDownPosition - e.MousePosition;

            return(Math.Abs(posDiff.X) > Math.Abs(posDiff.Y));
        }
예제 #7
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     isDragging = true;
     return(base.OnDragStart(e));
 }
예제 #8
0
 protected override bool OnDragStart(DragStartEvent e) => true;
예제 #9
0
파일: PlaylistList.cs 프로젝트: ry00001/osu
 protected override bool OnDragStart(DragStartEvent e)
 {
     nativeDragPosition = e.ScreenSpaceMousePosition;
     draggedItem        = items.FirstOrDefault(d => d.IsDraggable);
     return(draggedItem != null || base.OnDragStart(e));
 }
 protected override bool OnDragStart(DragStartEvent e)
 {
     handleMouseInput(e.ScreenSpaceMousePosition);
     return(true);
 }
예제 #11
0
 protected override bool OnDragStart(DragStartEvent e) => e.Button == MouseButton.Left;
예제 #12
0
 public override bool OnDragStart(DragStartEvent e)
 {
     return(onDragStart != null && onDragStart(e));
 }
예제 #13
0
파일: DragBox.cs 프로젝트: Tiller431/yes
 protected override bool OnDragStart(DragStartEvent e)
 {
     this.FadeIn(250, Easing.OutQuint);
     return(true);
 }
예제 #14
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     return(true);
 }
 protected override bool OnDragStart(DragStartEvent e)
 {
     dragOffset = e.MousePosition[(int)ScrollDirection] - Position[(int)ScrollDirection];
     return(true);
 }
예제 #16
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     AddUserVertex(e.MousePosition);
     DrawText.Text = "Custom Smoothed Drawn: Smoothed=" + NumVertices + ", Raw=" + NumRaw;
     return(true);
 }
예제 #17
0
 protected override bool OnDragStart(DragStartEvent e) => AllowDrag;
예제 #18
0
 protected override bool OnDragStart(DragStartEvent e)
 {
     // This text box is intended to be "read only" without actually specifying that.
     // As such we don't want to allow the user to select its content with a drag.
     return(false);
 }
예제 #19
0
 private void startArrangement(RearrangeableListItem <TModel> item, DragStartEvent e)
 {
     currentlyDraggedItem    = item;
     screenSpaceDragPosition = e.ScreenSpaceMousePosition;
 }