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

Border glitch during resize #462

Open
machur opened this issue Aug 20, 2023 · 6 comments
Open

Border glitch during resize #462

machur opened this issue Aug 20, 2023 · 6 comments

Comments

@machur
Copy link

machur commented Aug 20, 2023

Hi, I'm using QtInteractor as a plotter being located inside many other Qt Widgets. It looks like there is a glitch of border rendering on resize: when I resize the whole application window, incorrect borders tend to appear randomly for the plotter window and then disappear with further resizing - the issue remains though for many different window sizes. Example with bottom and/or right black borders added below:
image
image

I cannot fix it by using stylesheet or setting anything manually. Would you please advice? Is there a workaround?

@machur
Copy link
Author

machur commented Aug 22, 2023

I've observed that this happens on Windows with different scaling set than 100% (tested 125% and 135%).

@larsoner
Copy link
Contributor

Does it happen with 200% scaling? If not I'm guessing it has to do with the fractional scaling sometimes (but not others) making the render area 1px bigger than Qt expects due to rounding errors/differences (e.g., we round while they floor or similar)

@machur
Copy link
Author

machur commented Aug 22, 2023

@larsoner thanks for the quick reply. Yes, it looks like the issue. For 200% scaling there are no artifacts. Is there a feasible way to hack it?

I'm trying to figure out a way around it, hence my discussion #464 - as a workaround I tried to draw some rectangles over the plotter to simply cover the incorrect borders (I'm using wide margins anyway), but it didn't work either.

@larsoner
Copy link
Contributor

Can you try locally changing these to use np.floor rather than round?

w = int(round(scale*self.width()))

it might fix the problem, in which case we should make this change here and in the VTK gitlab source

@larsoner
Copy link
Contributor

(or math.floor probably since numpy doesn't appear to be used in that file)

@machur
Copy link
Author

machur commented Aug 23, 2023

I've tested np.floor/np.ceil/np.round and unfortunately the glitch is stilll there.

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

No branches or pull requests

2 participants