8000 ElementBounds.FixedUnder() Behaviour · Issue #45 · anegostudios/vsapi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ElementBounds.FixedUnder() Behaviour #45

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

Open
tacf opened this issue May 17, 2025 · 0 comments
Open

ElementBounds.FixedUnder() Behaviour #45

tacf opened this issue May 17, 2025 · 0 comments

Comments

@tacf
Copy link
tacf commented May 17, 2025

Hi,

I was attempting to do some simple ui stacking of elements using the available FixedUnder(). Basically iterating over the same bounds by doing X.FlatCopy().FixedUnder(X) which given the documentation associated with the function was the behaviour i expecetd. Unfortunately i found that there was a cumulative drift wit the elements. Upon digging i found out that as opposed to other similar functions, namely, FixedLeftOf and FixedRightOf the FixedUnder seems to be using += instead of =, hence accumulating and explaining the behavior i'm experiencing. The following lines is the one in question.

public ElementBounds FixedUnder(ElementBounds refBounds, double spacing = 0)
{
fixedY += refBounds.fixedY + refBounds.fixedHeight + spacing;

For reference here are the other similar functions,

public ElementBounds FixedRightOf(ElementBounds refBounds, double leftSpacing = 0)
{
fixedX = refBounds.fixedX + refBounds.fixedWidth + leftSpacing;

public ElementBounds FixedLeftOf(ElementBounds refBounds, double rightSpacing = 0)
{
fixedX = refBounds.fixedX - fixedWidth - rightSpacing;

As im not sure how is the contribution policy for the project, i've opted for not associating a PR with this issue.

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

No branches or pull requests

1 participant
0