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

live preview: Fix moving of elements #4645

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Conversation

hunger
Copy link
Member

@hunger hunger commented Feb 20, 2024

The positioning needs to happen relative to the position of the parent element, not using global coordinates.

@@ -71,6 +71,20 @@ pub fn find_element_indent(element: &ElementRc) -> Option<String> {
None
}

/// Try to find the parent of element `child` below `root`.
pub fn search_for_parent_element(root: &ElementRc, child: &ElementRc) -> Option<ElementRc> {
Copy link
Member

Choose a reason for hiding this comment

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

please avoid adding stuff to that module and keep helper function private near where they are used.
We can always move the function later if they are used by several modules

Copy link
Member

Choose a reason for hiding this comment

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

So now the function is there twice, and this one is unused

The positioning needs to happen relative to the position
of the parent element, not using global coordinates.
@hunger hunger merged commit f53a051 into slint-ui:master Feb 20, 2024
35 checks passed
@hunger hunger deleted the lp_fix_move branch February 20, 2024 13:04
@hunger
Copy link
Member Author

hunger commented Feb 22, 2024

You are right! Sorry for that! #4667 fixes this.

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

Successfully merging this pull request may close these issues.

2 participants