|
|
@ -55,7 +55,7 @@ namespace Avalonia.Windowing |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public double Scaling => 192 / 96; |
|
|
public double Scaling => _windowWrapper.GetScaleFactor(); |
|
|
|
|
|
|
|
|
public IEnumerable<object> Surfaces => new List<object>() { _windowWrapper }; |
|
|
public IEnumerable<object> Surfaces => new List<object>() { _windowWrapper }; |
|
|
|
|
|
|
|
|
@ -105,14 +105,12 @@ namespace Avalonia.Windowing |
|
|
|
|
|
|
|
|
public Point PointToClient(Point point) |
|
|
public Point PointToClient(Point point) |
|
|
{ |
|
|
{ |
|
|
// point = point.WithY(ClientSize.Height - point.Y);
|
|
|
|
|
|
var position = Position; |
|
|
var position = Position; |
|
|
return new Point(point.X + position.X, point.Y + position.Y); |
|
|
return new Point(point.X + position.X, point.Y + position.Y); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public Point PointToScreen(Point point) |
|
|
public Point PointToScreen(Point point) |
|
|
{ |
|
|
{ |
|
|
//point = point.WithY(ClientSize.Height - point.Y);
|
|
|
|
|
|
var position = Position; |
|
|
var position = Position; |
|
|
return new Point(point.X - position.X, point.Y - position.Y); ; |
|
|
return new Point(point.X - position.X, point.Y - position.Y); ; |
|
|
} |
|
|
} |
|
|
@ -174,9 +172,15 @@ namespace Avalonia.Windowing |
|
|
{ |
|
|
{ |
|
|
Dispatcher.UIThread.RunJobs(DispatcherPriority.Input); |
|
|
Dispatcher.UIThread.RunJobs(DispatcherPriority.Input); |
|
|
|
|
|
|
|
|
if (evt.EventType == MouseEventType.Move) |
|
|
switch(evt.EventType) |
|
|
{ |
|
|
{ |
|
|
_lastPosition = evt.Position; |
|
|
case MouseEventType.Move: |
|
|
|
|
|
_lastPosition = evt.Position; |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case MouseEventType.Wheel: |
|
|
|
|
|
Input(new RawMouseWheelEventArgs(MouseDevice, (uint)Environment.TickCount, _inputRoot, new Point(_lastPosition.X, _lastPosition.Y), new Point(evt.Position.X, evt.Position.Y), InputModifiers.None)); |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Input(new RawMouseEventArgs(MouseDevice, (uint)Environment.TickCount, _inputRoot, (RawMouseEventType)evt.EventType, new Point(_lastPosition.X, _lastPosition.Y), InputModifiers.None)); |
|
|
Input(new RawMouseEventArgs(MouseDevice, (uint)Environment.TickCount, _inputRoot, (RawMouseEventType)evt.EventType, new Point(_lastPosition.X, _lastPosition.Y), InputModifiers.None)); |
|
|
|