Merge branch 'main' into ly-as-sdk/LYN-2948
This commit is contained in:
+1
@@ -98,6 +98,7 @@ namespace AtomToolsFramework
|
||||
AZStd::optional<AZ::Vector3> ViewportScreenToWorld(const AzFramework::ScreenPoint& screenPosition, float depth) override;
|
||||
AZStd::optional<AzToolsFramework::ViewportInteraction::ProjectedViewportRay> ViewportScreenToWorldRay(
|
||||
const AzFramework::ScreenPoint& screenPosition) override;
|
||||
float DeviceScalingFactor() override;
|
||||
|
||||
//! Set interface for providing viewport specific settings (e.g. snapping properties).
|
||||
void SetViewportSettings(const AzToolsFramework::ViewportInteraction::ViewportSettings* viewportSettings);
|
||||
|
||||
@@ -313,8 +313,7 @@ namespace AtomToolsFramework
|
||||
// Scale the size by the DPI of the platform to
|
||||
// get the proper size in pixels.
|
||||
const QSize uiWindowSize = size();
|
||||
const qreal deficePixelRatio = devicePixelRatioF();
|
||||
const QSize windowSize = uiWindowSize * deficePixelRatio;
|
||||
const QSize windowSize = uiWindowSize * devicePixelRatioF();
|
||||
|
||||
const AzFramework::NativeWindowHandle windowId = reinterpret_cast<AzFramework::NativeWindowHandle>(winId());
|
||||
AzFramework::WindowNotificationBus::Event(windowId, &AzFramework::WindowNotifications::OnWindowResized, windowSize.width(), windowSize.height());
|
||||
@@ -465,6 +464,11 @@ namespace AtomToolsFramework
|
||||
return AzToolsFramework::ViewportInteraction::ProjectedViewportRay{rayOrigin, rayDirection};
|
||||
}
|
||||
|
||||
float RenderViewportWidget::DeviceScalingFactor()
|
||||
{
|
||||
return aznumeric_cast<float>(devicePixelRatioF());
|
||||
}
|
||||
|
||||
AzFramework::ScreenPoint RenderViewportWidget::ViewportCursorScreenPosition()
|
||||
{
|
||||
return AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(m_mousePosition.toPoint());
|
||||
|
||||
Reference in New Issue
Block a user