Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix zooming when in ortho mode #151

Merged
merged 1 commit into from
Nov 21, 2023
Merged

fix zooming when in ortho mode #151

merged 1 commit into from
Nov 21, 2023

Conversation

toloudis
Copy link
Contributor

@toloudis toloudis commented Nov 1, 2023

Orthographic camera zoom has been broken since the camera controls were redone. This fixes it.


float factor = 1.0f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe could use a more descriptive name... dragFactor? zoomFactor?

@@ -676,8 +675,14 @@ cameraManipulation(const glm::vec2 viewportSize, Gesture& gesture, CCamera& came
inline CCamera&
operator+=(CCamera& camera, const CameraModifier& mod)
{
// update OrthoScale as well - remember percentage change in distance
// from target to eye is the same as percentage change in ortho scale
float dold = glm::distance(camera.m_From, camera.m_Target);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: dOld?

@ShrimpCryptid
Copy link
Contributor

Oops forgot to write this, but I did build AGAVE locally and test it, and things seemed to be working as expected.

@toloudis toloudis merged commit 00fc499 into main Nov 21, 2023
7 checks passed
@toloudis toloudis deleted the fix/ortho-zoom branch November 21, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants