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 panel & label zoom value #581

Merged
merged 9 commits into from
Aug 20, 2024
Merged

Conversation

Rdornier
Copy link
Contributor

fix 2 small bugs regarding the zoom

  • update the panel when copy-pasting the zoom from one image to another.
  • cast to integer the value of the zoom when it is displayed as label

Before
image

After
image

@will-moore
Copy link
Member

Hi @Rdornier, apologies for the delayed response.
Can you describe the bug you're fixing a bit more? What exactly is "copy-pasting the zoom from one image to another"?

Without this PR, when I use the Copy and Paste buttons to copy the crop region from one panel to another, it seems to work OK for me.
However, to test the formatting of the label I created "zoom": 267.444 by creating a figure from hand-tweaked JSON. Copy and Paste of crop region didn't give the same zoom, probably due to rounding errors when converting zoom -> rectangle and then rectangle -> zoom:

After Copy from the top image and Paste to the lower one (Zoom slider and value have updated):

Screenshot 2024-08-05 at 17 30 51

@Rdornier
Copy link
Contributor Author

Rdornier commented Aug 8, 2024

Hi @will-moore

Thanks for checking.
The bug was, when I used the Copy and Paste buttons to copy the crop region between panels, the viewport and the slider didn't update "on the fly". I need to deselect the panel and select it again to see the changes.

However, this issue happened on my developement environment but I've just tried on the production server and this issue doesn't happend at all (both have the same version of omero.figure 7.0.0) ! So, forget about the panel update. I reversed the code to original.

Regarding the label formatting and different zooms, I fixed the rounding errors. It should be good now. I keep the zoom value as a float value everywhere except when it is displayed, in which case it is rounded.

@will-moore
Copy link
Member

Looks good, thanks.
Can you merge in the master branch and resolve the conflicts so that this branch is mergeable? Thx

@will-moore will-moore mentioned this pull request Aug 9, 2024
@will-moore will-moore merged commit 47f4948 into ome:master Aug 20, 2024
1 check passed
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