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

JDK-8302846: IGV: Zoom stuck when zooming out on large graphs #12652

Closed
wants to merge 2 commits into from

Conversation

tobiasholenstein
Copy link
Contributor

@tobiasholenstein tobiasholenstein commented Feb 20, 2023

Problem

In the IdealGraphVisualizer (IGV) the user can zoom in and out using either the mouse-wheel or by entering/selecting a value in the zoom combo-box. The zoom combo-box is implemented in ZoomLevelAction.java:

  • ZoomLevelAction has a listener on scene.getZoomChangedEvent() which calls changed(..) each time the zoom level of the diagramScene changes, e.g. when the user zooms in/out with the mouse-wheel.
  • actionPerformed(..) is called when the user enters/selects a zoom level in the combo-box, in which case it calls setZoomLevel(..) -> diagramScene.setZoomPercentage(zoomLevel) to update the zooming of the scene.
  • changed(..) calls setSelectedItem(..) which updates the content of the combo-box and triggers a also a call to actionPerformed(..). Unfortunately, in this case we should not call diagramScene.setZoomPercentage(zoomLevel) because the diagramScene is updating the ZoomLevelAction and not vice versa. The problem only reveals for small zooming level because ZoomLevelAction uses an integer for the zooming level (1-100%) while the diagramScene uses a float (1.0f is 100%). In the example where the bug occurs, mouse wheel zooming changed zoom level in diagramScene from 0.01 to 0.012 - then diagramScene updates the ZoomLevelAction which rounds 1.2% to 1% : and now the BUG: ZoomLevelAction sets diagramScene zooming again to 0.01. The zooming is stuck at 0.01

Solution

When diagramScene updates the ZoomLevelAction, actionPerformed(..) should not call diagramScene.setZoomPercentage(zoomLevel). So we introduce a boolean updateZoomInScene that is set to false when a change of zoom in diagramScene triggered the actionPerformed(..)


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8302846: IGV: Zoom stuck when zooming out on large graphs

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12652/head:pull/12652
$ git checkout pull/12652

Update a local copy of the PR:
$ git checkout pull/12652
$ git pull https://git.openjdk.org/jdk pull/12652/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12652

View PR using the GUI difftool:
$ git pr show -t 12652

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12652.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 20, 2023

👋 Welcome back tholenstein! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Feb 20, 2023

@tobiasholenstein The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Feb 20, 2023
@tobiasholenstein tobiasholenstein marked this pull request as ready for review February 20, 2023 13:09
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 20, 2023
@mlbridge
Copy link

mlbridge bot commented Feb 20, 2023

Webrevs

Copy link
Contributor

@robcasloz robcasloz left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this, Toby! Please update the copyright header.

@openjdk
Copy link

openjdk bot commented Feb 20, 2023

@tobiasholenstein This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8302846: IGV: Zoom stuck when zooming out on large graphs

Reviewed-by: rcastanedalo, thartmann

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 75 new commits pushed to the master branch:

  • 92dfa11: 8302863: Speed up String::encodeASCII using countPositives
  • 8b20aa9: 8302981: Fix a typo in the doc comment for java.lang.Record.equals
  • 644fe0a: 8302837: Kernel32.cpp array memory release invokes undefined behaviour
  • 60e6378: 8302977: ZGC: Doesn't support gc/TestVerifySubSet.java
  • fef1910: 8299777: Test runtime/NMT/BaselineWithParameter.java timed out
  • 622f560: 8302886: Parallel: Remove unimplemented methods in ParCompactionManager
  • 9fd77c7: 8302868: Serial: Remove CardTableRS::initialize
  • f35cf79: 8302867: G1: Removing unused variable in G1CardTable::initialize
  • 63a3501: 8302741: ZGC: Remove Universe::verify calls
  • 9145670: 8301661: Enhance os::pd_print_cpu_info on macOS and Windows
  • ... and 65 more: https://git.openjdk.org/jdk/compare/2e3cea01daca594dfa4477439a9849eea19b249e...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 20, 2023
Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@tobiasholenstein
Copy link
Contributor Author

thanks @robcasloz and

Thanks for fixing this, Toby! Please update the copyright header.

done

@tobiasholenstein
Copy link
Contributor Author

Thanks @robcasloz and @TobiHartmann for the reviews!

/integrate

@openjdk
Copy link

openjdk bot commented Feb 21, 2023

Going to push as commit 02eb240.
Since your change was applied there have been 75 commits pushed to the master branch:

  • 92dfa11: 8302863: Speed up String::encodeASCII using countPositives
  • 8b20aa9: 8302981: Fix a typo in the doc comment for java.lang.Record.equals
  • 644fe0a: 8302837: Kernel32.cpp array memory release invokes undefined behaviour
  • 60e6378: 8302977: ZGC: Doesn't support gc/TestVerifySubSet.java
  • fef1910: 8299777: Test runtime/NMT/BaselineWithParameter.java timed out
  • 622f560: 8302886: Parallel: Remove unimplemented methods in ParCompactionManager
  • 9fd77c7: 8302868: Serial: Remove CardTableRS::initialize
  • f35cf79: 8302867: G1: Removing unused variable in G1CardTable::initialize
  • 63a3501: 8302741: ZGC: Remove Universe::verify calls
  • 9145670: 8301661: Enhance os::pd_print_cpu_info on macOS and Windows
  • ... and 65 more: https://git.openjdk.org/jdk/compare/2e3cea01daca594dfa4477439a9849eea19b249e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 21, 2023
@openjdk openjdk bot closed this Feb 21, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 21, 2023
@openjdk
Copy link

openjdk bot commented Feb 21, 2023

@tobiasholenstein Pushed as commit 02eb240.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants