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

Fix get_item_area_rect when tree is scrolled #102116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Giganzo
Copy link
Contributor

@Giganzo Giganzo commented Jan 28, 2025

Fixes: #102115

Updated with more fixes, see #102116 (comment)

Fixes: #71997

@Giganzo Giganzo requested a review from a team as a code owner January 28, 2025 10:45
@AThousandShips AThousandShips changed the title Fix get_item_area_rect when tree is scrolled Fix get_item_area_rect when tree is scrolled Jan 28, 2025
@AThousandShips AThousandShips added this to the 4.4 milestone Jan 28, 2025
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good and seems to be working as expected.

But some places in the editor code use this and do adjust for scroll manually, so these should be changed as well.

Vector2 popup_pos = tree->get_screen_transform().xform(pos.position + Vector2(0, pos.size.height)) - tree->get_scroll();

Vector2 popup_pos = tree->get_screen_transform().xform(pos.position + Vector2(0, pos.size.height)) - tree->get_scroll();

@Giganzo Giganzo force-pushed the tree-get_item_rect branch from a0be012 to 05d6974 Compare January 28, 2025 13:16
@Giganzo
Copy link
Contributor Author

Giganzo commented Jan 28, 2025

But some places in the editor code use this and do adjust for scroll manually, so these should be changed as well.
...

Fixed in animation_library_editor.cpp.

Other issues

Found some other already existing issues, that I currently don't know how to fix.

RtL

Rect position of specified column is not correct when control is set to RtL

Screencast_20250128_091631.webm

Button and expanding columns

Buttons rect position is not correct. Believe it is because it's using full width even when columns is not fully expanded.

Screenshot_20250128_090733

Screenshot_20250128_090757

Should these issues be reported as separate issues that can be fixed in a new pr?

@bruvzg
Copy link
Member

bruvzg commented Jan 28, 2025

Should these issues be reported as separate issues that can be fixed in a new pr?

If you already have a fix, it can be added directly to this PR, if not open a new issue.

@bruvzg bruvzg self-requested a review January 28, 2025 18:54
@Giganzo
Copy link
Contributor Author

Giganzo commented Jan 29, 2025

If you already have a fix, it can be added directly to this PR, if not open a new issue.

I have some potential fixes for some of the other issues, the RtL is actually two different issues. Should I still push the fixes to this PR (might be a day or two)?

But also discovered more issues with the tree, don't think I can solve all of them or if they would be correct to put in this PR. If they are not already reported I will make new issues for them later.

@Giganzo Giganzo force-pushed the tree-get_item_rect branch from 05d6974 to bde87db Compare January 30, 2025 13:33
@Giganzo
Copy link
Contributor Author

Giganzo commented Jan 30, 2025

Updated PR with new fixes.

RtL

Should now work for column and buttons.

Button rect

  1. Now works when tree is scrolled horizontally.
  2. Height is the full size.

There is an issue #100645 with the buttons jiggiling when scrolling horizontally. This makes the rect be slightly off in some cases. But the fix should most likley be to stop them from jiggiling around.

Theme properies

Should account for theme properties now. Fixes: #71997

Not sure if the first option (TreeItem) should include horizontal theme properties or not. Can add them in if they should be accounted for.

Description

There might also be a problem with the description, it says:

If column is specified, only get the position and size of that column, otherwise get the rectangle containing all columns.

It sounds like it should give a rect that have the size of all combined columns when only specifing a TreeItem?
This has never been the case, from what I can see. So maybe the documentation needs to change?

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