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

Height overflow when adding large number of nodes #1260

Open
jin-x opened this issue Jun 29, 2024 · 5 comments
Open

Height overflow when adding large number of nodes #1260

jin-x opened this issue Jun 29, 2024 · 5 comments

Comments

@jin-x
Copy link

jin-x commented Jun 29, 2024

Hello.

When setting large number of nodes (e.g. 200 millions) then the value of NewHeight overflows in method TBaseVirtualTree.SetChildCount (look here). Because it have type TDimension = Integer (defined here). So list is fixed (doesn't move), vertical scroll bar is absent and exception occurs in Debug mode.

@joachimmarder
Copy link
Contributor

Please respect our guidelines on the project homepage for submitting bugs. Please include your version of Virtual TreeView and Delphi, and attach a sample compiling project as ZIP to your report that allows to replicate the problem. If only small changes are required, a description is sufficient how a demo projects needs to be changed in order to replicate the bug. If you already have a solution, please supply a patch file.

@joachimmarder
Copy link
Contributor

When setting large number of nodes (e.g. 200 millions) t

I honestly don't think it is a good idea to present 200 million nodes to a user, even if that would be theortically and technically possible.

Because it have type TDimension = Integer

Where possible we could use NativeInt instead of Integer. That way we can overcome this limit in Win64 applications.

@joachimmarder
Copy link
Contributor

I gave it a try, let me know what you think.

@jin-x
Copy link
Author

jin-x commented Jul 1, 2024

@joachimmarder, thanks for answers and sorry for wrong report design.
RAD Studio 12.1 (version 29.0.51961.7529).
VirtualTreeView version 8.0.3.
Demo project: HeightErrorDemo.zip
There's 50 million nodes with large font size.

Unfortunately, your fix with TNodeHeight alias did not solve the problem, in fact nothing has changed :(

@joachimmarder
Copy link
Contributor

I used the new type TNodeHeight at a few more places and the control now displays correctly, but you can't scroll to the bottom. The problem is that certain type like the Win32 SCROLLINFO struct and TRect are based on Integer (Int32) and so are limited to 2^31 pixels.

I still don't think it is a good idea to present >50 million nodes to a user.

salvadorbs pushed a commit to salvadorbs/VirtualTreeView-Lazarus that referenced this issue Sep 26, 2024
salvadorbs pushed a commit to salvadorbs/VirtualTreeView-Lazarus that referenced this issue Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants