示例#1
0
        void OnMouseMove(MouseMoveEvent evt)
        {
            if (evt.button != 0)
            {
                return;
            }

            if (!textInputField.HasMouseCapture())
            {
                return;
            }

            textInputField.SyncTextEngine();
            m_Changed = false;

            // FIXME: presing shift while dragging will change start of selection (alt cursor).
            // Also, adding to selection (with shift click) after a drag-select does not work: it clears the previous selection.
            if (!evt.shiftKey && editorEngine.hasSelection && m_DragToPosition)
            {
                editorEngine.MoveAltCursorToPosition(evt.localMousePosition);
            }
            else
            {
                if (evt.shiftKey)
                {
                    editorEngine.MoveCursorToPosition_Internal(evt.localMousePosition, evt.shiftKey);
                }
                else
                {
                    editorEngine.SelectToPosition(evt.localMousePosition);
                }

                m_DragToPosition     = false;
                m_SelectAllOnMouseUp = !editorEngine.hasSelection;
            }
            m_Dragged = true;

            evt.StopPropagation();

            // Scroll offset might need to be updated
            editorEngine.UpdateScrollOffset();
        }
示例#2
0
        protected void OnMouseMove(MouseMoveEvent e)
        {
            if (!m_Active || !target.HasMouseCapture())
            {
                return;
            }

            Vector2 diff      = e.localMousePosition - m_Start;
            float   mouseDiff = diff.x;

            if (m_Orientation == SplitPannel.Orientation.Vertical)
            {
                mouseDiff = diff.y;
            }

            float delta = m_Direction * mouseDiff;

            ApplyDelta(delta);

            e.StopPropagation();
        }
示例#3
0
        private void OnMouseMove(MouseMoveEvent evt)
        {
            bool flag = evt.button != 0;

            if (!flag)
            {
                bool flag2 = !base.textInputField.HasMouseCapture();
                if (!flag2)
                {
                    base.textInputField.SyncTextEngine();
                    this.m_Changed = false;
                    bool flag3 = !evt.shiftKey && base.editorEngine.hasSelection && this.m_DragToPosition;
                    if (flag3)
                    {
                        base.editorEngine.MoveAltCursorToPosition(evt.localMousePosition);
                    }
                    else
                    {
                        bool shiftKey = evt.shiftKey;
                        if (shiftKey)
                        {
                            base.editorEngine.MoveCursorToPosition_Internal(evt.localMousePosition, evt.shiftKey);
                        }
                        else
                        {
                            base.editorEngine.SelectToPosition(evt.localMousePosition);
                        }
                        this.m_DragToPosition     = false;
                        this.m_SelectAllOnMouseUp = !base.editorEngine.hasSelection;
                    }
                    this.m_Dragged = true;
                    evt.StopPropagation();
                    base.editorEngine.UpdateScrollOffset();
                }
            }
        }