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 rendering of vertexes of shape layers with small scale #6628

Merged
merged 1 commit into from Jan 30, 2024

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented Jan 29, 2024

References and relevant issues

Bug spotted in context #6627

Description

After changes in #5802 the vertex border is very thick:

Zrzut ekranu z 2024-01-29 15-09-03

This PR reverts this change as Marker's size is in absolute unit, not data unit.

image

Script for reproduce:

import napari
import numpy as np


s = (0.01, 0.005, 0.005)
s = (0.005, 0.005, 0.005)
s = (0.01, 0.01, 0.01)
s = (0.1, 0.1, 0.1)
# s = (1, 1, 1)
viewer = napari.Viewer()
layers = viewer.open_sample("napari", "cells3d")
for l in layers:
    l.scale = s

shapes = viewer.add_shapes(
    np.array(
        [
            [29.0, 130.70802005, 86.37901572],
            [29.0, 130.70802005, 137.70733652],
            [29.0, 182.32797904, 137.70733652],
            [29.0, 182.32797904, 86.37901572],
        ]
    ),
    scale=s,
)
shapes.mode = "select"
viewer.dims.current_step = (29, 0, 0)
viewer.reset_view()

napari.run()

@Czaki Czaki added this to the 0.4.19 milestone Jan 29, 2024
@Czaki Czaki added priority-high High priority issue bugfix PR with bugfix labels Jan 29, 2024
@Czaki Czaki requested a review from brisvag January 29, 2024 15:43
Copy link
Contributor

@brisvag brisvag left a comment

Choose a reason for hiding this comment

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

Nice detective work! This code is all scattered around and it was hard to follow, it's a pity it slipped through :/

Good that this works still with anisotropic scales!

@jni jni added the ready to merge Last chance for comments! Will be merged in ~24h label Jan 29, 2024
@Czaki Czaki merged commit 1d37904 into napari:v0.4.19x Jan 30, 2024
29 checks passed
@Czaki Czaki deleted the fix_thickness_0.4.19 branch January 30, 2024 08:42
@Czaki Czaki removed the ready to merge Last chance for comments! Will be merged in ~24h label Jan 30, 2024
Czaki added a commit that referenced this pull request Feb 5, 2024
…dinates (#6629)

# References and relevant issues

This PR is created as result of debug
#6627 (comment)
As 0.4.19 branch has fewer problems than #6628 is created for 0.4.19. 

# Description

Fix logic for selecting of visible shapes based on idea from #2289. It
is lucky that we do not hit this earlier.

Removes scaling of width of markers border (this is same like in #6628)

To improve readability, this update `ShapesVisual` to have named
subvisuals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix priority-high High priority issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants