Fix mipmapLevel/RenderScale bugs related to overlay code. #919
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. Additionally, make sure you've done all of these things:
PR Description
What type of PR is this? (Check one of the boxes below)
What does this pull request do?
Fixed a conversion from mipMapLevel to RenderScale that appeared to be the inverse of what it should have been. No other mipMapLevel to RenderScale conversion anywhere else in the codebase matched this particular conversion. Code that calls this function also tries to reverse the conversion expecting the more popular mapping which also implies that the conversion is a bug.
Changed ViewerGL::mouseDoubleClickEvent() to use getCurrentRenderScale() to get the current mipMapLevel so that it matches all the other code that computes a RenderScale for a notifyOverlaysXXX method.
Have you tested your changes (if applicable)? If so, how?
I tried to find places where I could test these changes, but it appears that these 2 behaviors are not actually observed by any of the Natron plugins or nodes that they would affect.
The first fix is observable in changedParam() callbacks in plugins like HSVTool, Grade, Noop, ColorLookup, etc. but none of those plugins actually use the RenderScale value. The RenderScale gets passed to the plugin's processor and then the value is completely ignored during processing. I've verified the value passed to these plugins is correct now, but this doesn't appear to actually affect their behavior because they were not using the values to begin with.
The second fix is also observable, but existing code does not use the values. OFX Plugins don't receive the overlay double click event so there is no impact there. The RotoPaint and Tracking code ignore the render scale parameter for double click events so there is no impact to that code right now either.
Futher details of this pull request
I came across these issues while exploring some RenderScale/mipMapLevel refactoring ideas. Even though these issues aren't causing problems in the existing code, it seems worth fixing them. They could cause problems if the RenderScale values ever did get used and they are inconsistent with similar code.