Skip to content

Fix slider widget coordinate parameters#511

Merged
banesullivan merged 1 commit intomasterfrom
fix_add_slider_widget
Dec 19, 2019
Merged

Fix slider widget coordinate parameters#511
banesullivan merged 1 commit intomasterfrom
fix_add_slider_widget

Conversation

@GuillaumeFavelier
Copy link
Copy Markdown
Contributor

This PR fixes a bug with the input coordinates of the slider widget.

To reproduce:

import pyvista as pv


def foo(v):
    pass


rng = [0, 1]
left = [[0.1, -0.3],
        [0.1, 1.3]]
right = [[0.9, -0.3],
         [0.9, 1.3]]
p = pv.Plotter()
p.add_slider_widget(foo, rng=rng, title='left', pointa=left[0], pointb=left[1])
p.add_slider_widget(foo, rng=rng, title='right', pointa=right[0], pointb=right[1])
p.show()
master PR
2019-12-19_1920x1080 2019-12-19_1920x1080

@GuillaumeFavelier
Copy link
Copy Markdown
Contributor Author

Also I expected the normalized coordinate system to be between 0 and 1 but for some reason, the y-axis doesn't respect this rule.

@banesullivan
Copy link
Copy Markdown
Member

Thanks for fixing this!

@GuillaumeFavelier
Copy link
Copy Markdown
Contributor Author

Also a render to describe the different components of the slider:

2019-12-19_1920x1080

@banesullivan
Copy link
Copy Markdown
Member

@GuillaumeFavelier, squash and merge this whenever you're ready

@GuillaumeFavelier
Copy link
Copy Markdown
Contributor Author

I'm not authorized to merge this pull request, I let you take care of it.

@banesullivan
Copy link
Copy Markdown
Member

Oh weird... I thought you were

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