@@ -1514,7 +1514,8 @@ namespace FlaxEditor
|
||||
var win = Windows.GameWin?.Root;
|
||||
if (win?.RootWindow is WindowRootControl root)
|
||||
{
|
||||
pos = Float2.Round(Windows.GameWin.Viewport.PointFromScreen(pos) * root.DpiScale);
|
||||
pos = Windows.GameWin.Viewport.PointFromScreen(pos);
|
||||
pos = Float2.Round(pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1527,7 +1528,8 @@ namespace FlaxEditor
|
||||
var win = Windows.GameWin?.Root;
|
||||
if (win?.RootWindow is WindowRootControl root)
|
||||
{
|
||||
pos = Float2.Round(Windows.GameWin.Viewport.PointToScreen(pos / root.DpiScale));
|
||||
pos = Windows.GameWin.Viewport.PointToScreen(pos);
|
||||
pos = Float2.Round(pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1559,6 +1561,7 @@ namespace FlaxEditor
|
||||
else
|
||||
result = gameWin.Viewport.Size;
|
||||
|
||||
result *= root.DpiScale;
|
||||
result = Float2.Round(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ Float2 Screen::ScreenToGameViewport(const Float2& screenPos)
|
||||
return Editor::Managed->ScreenToGameViewport(screenPos);
|
||||
#else
|
||||
auto win = Engine::MainWindow;
|
||||
return win ? win->ScreenToClient(screenPos) : Float2::Minimum;
|
||||
return win ? win->ScreenToClient(screenPos) / win->GetDpiScale() : Float2::Minimum;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ Float2 Screen::GameViewportToScreen(const Float2& viewportPos)
|
||||
return Editor::Managed->GameViewportToScreen(viewportPos);
|
||||
#else
|
||||
auto win = Engine::MainWindow;
|
||||
return win ? win->ClientToScreen(viewportPos) : Float2::Minimum;
|
||||
return win ? win->ClientToScreen(viewportPos * win->GetDpiScale()) : Float2::Minimum;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user