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

Root toggle node buttons are partially drawn even if toShowRoot is False. #811

Closed
transmogrifix opened this issue Jul 4, 2018 · 7 comments
Assignees
Labels
Milestone

Comments

@transmogrifix
Copy link

transmogrifix commented Jul 4, 2018

Hi,

Commit ad586ea has introduced a regression in drawing of toggle node buttons. When toShowRoot is turned off, the toggle buttons of root nodes should not be visible, but currently they are partially visible.

To reproduce, run the provided example and have a look at the leftmost column.
example.zip

The issue seems to be in TBaseVirtualTree.PaintTree, before the mentioned commit an offset (ofsControlMargin) was being applied :
PaintNodeButton(Canvas, Node, Column, CellRect, Offsets[ofsToggleButton] - Offsets[ofsControlMargin], ButtonY, BidiMode);
and after the commit it's not:
PaintNodeButton(Canvas, Node, Column, CellRect, Offsets[ofsToggleButton], ButtonY, BidiMode);

The master branch no longer contains ofsControlMargin, so I assume this offset should be applied in some other way?

@joachimmarder
Copy link
Contributor

The master branch no longer contains ofsControlMargin

This was introduced for #369 and has been renamed to ofsMargin, as it needs to be applied to every column.

#369 was a major refactoring in several steps. Thanks to #369 it should hopefully be easy to fix this in GetOffsets().

@joachimmarder joachimmarder self-assigned this Jul 5, 2018
@joachimmarder joachimmarder added this to the V7.0 milestone Jul 5, 2018
@joachimmarder
Copy link
Contributor

joachimmarder commented Jul 8, 2018

the toggle buttons of root nodes should not be visible, but currently they are partially visible.

I compiled your project with Delphi 10.2.3 and the latest VTV source from GitHub master but could not see any partially painted toggle buttons. Can you please submit a screenshot?

@joachimmarder joachimmarder added the Repro Steps Missing A smple project is needed to reprodcue and analyze the issue. See our guidelines for opening issues! label Jul 8, 2018
@transmogrifix
Copy link
Author

transmogrifix commented Jul 8, 2018

toggle-buttons

I am using Delphi 10.2.1 and the latest master.

@joachimmarder
Copy link
Contributor

Here's my screenshot:
grafik

@joachimmarder
Copy link
Contributor

joachimmarder commented Jul 8, 2018

It seems that there is an additional 1 pixel offset in your screenshot that could be a result of the refactorings for #369. Increasing the value of the property Margin to 8 makes the problem appear for sure

Actually the toggle buttons should not be painted at all, but previous version just properly painted them outside the viewport.

joachimmarder pushed a commit that referenced this issue Jul 8, 2018
@transmogrifix
Copy link
Author

Yes, it seems that there is some additional offset. Also, I agree, they shouldn't be painted at all. I found that curious as well :)

But I don't really understand why you don't see it. My first screenshot was on Windows 8.1, here is another on Windows 7 (with basic theme) :
toggle-buttons2
I don't have any other versions to test on.

@joachimmarder joachimmarder removed the Repro Steps Missing A smple project is needed to reprodcue and analyze the issue. See our guidelines for opening issues! label Jul 8, 2018
@transmogrifix
Copy link
Author

That fixed it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants