mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-19 22:44:59 +01:00
fix(editor): no pan of the perspective view started on the sky, where the depth keeps the last hit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ
This commit is contained in:
@@ -5740,7 +5740,7 @@ void editor_mode::on_mouse_button(int const Button, int const Action, int const
|
||||
{
|
||||
auto const &io{ImGui::GetIO()};
|
||||
auto const distance{glm::length(GfxRenderer->Mouse_Position())};
|
||||
if (io.DisplaySize.y > 0.0f && distance > 0.5 && distance < 20000.0)
|
||||
if (GfxRenderer->Mouse_Hit() && io.DisplaySize.y > 0.0f && distance > 0.5 && distance < 20000.0)
|
||||
m_pan_metres = 2.0 * distance * std::tan(glm::radians(Global.FieldOfView / Global.ZoomFactor) * 0.5) / static_cast<double>(io.DisplaySize.y);
|
||||
else
|
||||
m_ortho_pan = false; // nothing under the cursor to hold
|
||||
|
||||
Reference in New Issue
Block a user