void Expand(IPointerDevice e) { Point pointerRelative = e.GetPosition(this); PixelPoint pointerAbsolute = new PixelPoint( (int)(Position.X + pointerRelative.X), (int)(Position.Y + pointerRelative.Y) ); Screen result = null; foreach (Screen screen in Screens.All) { if (screen.Bounds.Contains(pointerAbsolute)) { result = screen; break; } } if (result != null) { Position = new PixelPoint(result.Bounds.X, Position.Y); Width = result.Bounds.Width; } }
internal TextViewPosition?GetPositionFromMousePosition(IPointerDevice mouse) { var position = textEditor.TextArea.TextView.GetPosition(mouse.GetPosition(textEditor.TextArea.TextView) + textEditor.TextArea.TextView.ScrollOffset); if (position == null) { return(null); } var lineLength = textEditor.Document.GetLineByNumber(position.Value.Line).Length + 1; if (position.Value.Column == lineLength) { return(null); } return(position); }
internal TextViewPosition?GetPositionFromMousePosition() { IPointerDevice mouse = MainWindow.Instance.PlatformImpl.MouseDevice; var position = textEditor.TextArea.TextView.GetPosition(mouse.GetPosition(textEditor.TextArea.TextView) + textEditor.TextArea.TextView.ScrollOffset); if (position == null) { return(null); } var lineLength = textEditor.Document.GetLineByNumber(position.Value.Line).Length + 1; if (position.Value.Column == lineLength) { return(null); } return(position); }