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 for "Sliders in examples don't react properly to clicks" #1457

Merged
merged 4 commits into from
Apr 5, 2018

Conversation

karandeepSJ
Copy link
Contributor

This PR fixes issue #1454

  • A callback was added to call translate_green_cube on "LeftButtonPressEvent".
  • Priority given to self.line_click_callback in ui.py to ensure that the position of disk gets updated before moving the cube.

@codecov-io
Copy link

codecov-io commented Mar 13, 2018

Codecov Report

Merging #1457 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1457      +/-   ##
==========================================
- Coverage   87.49%   87.48%   -0.01%     
==========================================
  Files         241      241              
  Lines       30789    30805      +16     
  Branches     3322     3322              
==========================================
+ Hits        26939    26951      +12     
- Misses       3074     3078       +4     
  Partials      776      776
Impacted Files Coverage Δ
dipy/viz/ui.py 89.3% <ø> (ø) ⬆️
dipy/core/graph.py 73.8% <0%> (-1.2%) ⬇️
dipy/viz/tests/test_actors.py 73.67% <0%> (-0.96%) ⬇️
dipy/reconst/forecast.py 92.22% <0%> (+2.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6af802...66b86c1. Read the comment docs.

dipy/viz/ui.py Outdated
@@ -1851,7 +1851,7 @@ def handle_events(self, actor):

"""
self.add_callback(self.slider_line, "LeftButtonPressEvent",
self.line_click_callback)
self.line_click_callback,1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a space after the , in accordance with PEP8.

line_slider = ui.LineSlider2D(initial_value=-2,
min_value=-5, max_value=5)

line_slider.add_callback(line_slider.slider_disk,
"MouseMoveEvent",
translate_green_cube)

line_slider.add_callback(line_slider.slider_line,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you do the same for the disk slider also? Let's merge both these into this PR.

@dmreagan
Copy link
Contributor

Please also update viz_advanced.py. Once that is done, I think this is ready to merge.

@skoudoro
Copy link
Member

skoudoro commented Apr 3, 2018

is it ready to go @dmreagan?

@dmreagan dmreagan merged commit 52ca2ae into dipy:master Apr 5, 2018
ShreyasFadnavis pushed a commit to ShreyasFadnavis/dipy that referenced this pull request Sep 20, 2018
Fix for "Sliders in examples don't react properly to clicks"
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.

5 participants