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

Viewport values should be clamped between 0 and 1 #20261

Open
biagas opened this issue Feb 25, 2025 · 2 comments
Open

Viewport values should be clamped between 0 and 1 #20261

biagas opened this issue Feb 25, 2025 · 2 comments
Labels
bug Something isn't working impact medium Productivity partially degraded (not easily mitigated bug) or improved (enhancement) likelihood low Occurrence/expected use specific to data, operators, configuration, etc. or combinations thereof

Comments

@biagas
Copy link
Contributor

biagas commented Feb 25, 2025

Describe the bug

If Viewport coordinates get set outside the values of 0 and 1, the view calculations for zoom (and possibly others) don't work correctly.

This was reported by customer. See discussion 20260

Reproducer:

OpenDatabase("rect2d.silo")
AddPlot("Pseudocolor", "d", 1, 1)
AddPlot("Pseudocolor", "p", 1, 0)
AddOperator("Reflect", 0)
SetActivePlots(1)
ReflectAtts = ReflectAttributes()
ReflectAtts.octant = ReflectAtts.PXPYPZ  # PXPYPZ, NXPYPZ, PXNYPZ, NXNYPZ, PXPYNZ, NXPYNZ, PXNYNZ, NXNYNZ
ReflectAtts.reflections = (0, 1, 0, 0, 0, 0, 0, 0)
ReflectAtts.reflectType = ReflectAtts.Axis  # Plane, Axis
SetOperatorOptions(ReflectAtts, 0, 0)

View2DAtts = View2DAttributes()
# set the max-x > 1
View2DAtts.viewportCoords = (0.2, 1.2, 0.15, 0.95)
SetView2D(View2DAtts)

DrawPlots()
ResetView()

Here's the plot before zooming with the border between the reflected and non-reflected plots at x=0

Image

And after zooming, the border between the reflected and non-reflected plots has 'moved'.

Image

When the 2DView values are set between 0, and 1, then the view after zooming is still correct.

Expected behavior

If the view calculations won't be correct if Viewport values are outside the range of 0,1, then they should be automatically clamped.

Desktop

  • OS and version: [e.g. Ubuntu 14.04]
  • VisIt Version: 3.4.2
@biagas biagas added bug Something isn't working impact medium Productivity partially degraded (not easily mitigated bug) or improved (enhancement) likelihood low Occurrence/expected use specific to data, operators, configuration, etc. or combinations thereof labels Feb 25, 2025
@markcmiller86
Copy link
Member

Do we understand what @awcook was trying to achieve with setting the high X value of the viewport to above 1? It may have been inadvertent entry from previous fiddling. However, I feel like we should understand what lead the user to setting that and whether the setting had some positive effect in another way.

That isn't to suggest we should allow values outside [0,1]. But, maybe we need settings elsewhere that give the user the control they were seeking.

FYI...I don't see oddities without some kind of an operator in place...Reflect or Transform or something. If I just have a 2D database open and a PC plot up, as I fiddle with viewport values above 1, I don't see view change in any way. But, if I use Transform to rotate or Reflect then a see substantial changes in view as I vary high X value of viewport above 1.

@biagas
Copy link
Contributor Author

biagas commented Feb 25, 2025

@awcook set the viewport in the manner he did to make his movie look good in widescreen format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working impact medium Productivity partially degraded (not easily mitigated bug) or improved (enhancement) likelihood low Occurrence/expected use specific to data, operators, configuration, etc. or combinations thereof
Projects
None yet
Development

No branches or pull requests

2 participants