示例#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
 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);
 }
 protected override bool OnDragStart(DragStartEvent e)
 {
     AddUserVertex(e.MousePosition);
     DrawText.Text = "Custom Smoothed Drawn: Smoothed=" + NumVertices + ", Raw=" + NumRaw;
     return(true);
 }
 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;
 }