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 ElementHandle resizing incorrectly when the size_target has "box-sizing: border-box" #215

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

nimble0
Copy link

@nimble0 nimble0 commented Jul 26, 2021

This is an example of the issue. When the drag starts it jumps so that the cursor is below the blue box instead of in the middle where it started.

drag-jump

@mikke89
Copy link
Owner

mikke89 commented Jul 26, 2021

Thanks for the PR!

One issue with the proposed solution is that not all elements specify their width and height properties. Eg. when one uses top/left/bottom/right properties on a window body, which is a quite common case.

I think a better fix is to get the target's computed box sizing property GetComputedValues().box_sizing and select between the formatted box's content size and border size (Box::CONTENT and Box::BORDER) accordingly, if that makes sense.

@mikke89 mikke89 added the bug Something isn't working label Jul 26, 2021
@nimble0 nimble0 force-pushed the fix/box-sizing-drag-resizing branch from 1195a87 to 486d47b Compare July 29, 2021 07:21
@nimble0
Copy link
Author

nimble0 commented Jul 29, 2021

That makes sense, I've updated it to do that.

@mikke89 mikke89 merged commit 04533be into mikke89:master Jul 29, 2021
@mikke89
Copy link
Owner

mikke89 commented Jul 29, 2021

Perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants