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

Switching Viewer (Flipbook=>SeparateFrame) incorrectly calculates scale value #5833

Open
kieftrav opened this issue Jan 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kieftrav
Copy link
Contributor

kieftrav commented Jan 9, 2024

Package

  • [ x ] lib-classifier

Describe the bug

When switching from FlipbookViewer to SeparateFramesViewer the scale attribute is not being set correctly. Specifically, in the SeparateFrame.js the scale value is not being calculated correctly due to incorrect values from the subjectImage.current?.getBoundingClientRect() calculation.

To Reproduce

Steps to reproduce the behavior:

  1. Open the Test MultiFrame Project in the lib-classifier locally.
  2. Add console.log() statements for the zoom and scale variables right before the component is returned (line 207)
  3. Switch to separate frames view from the UI. Note the zoom and scale values
  4. Click to zoom in & then zoom out. Note that the zoom is the same (1) and the scale is vastly different (.214 to .792) for myself

The calculation for the scale is dependent upon the subjectImage.current?.getBoundingClientRect() to be correct and for some reason it's not when we switch viewers. Zoom in + out correctly recalculates, but the initial render does not.

Screenshots

Screenshot 2024-01-09 at 1 13 59 PM

Expected behavior

The scale should be correctly calculated when switching the view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant