-
Notifications
You must be signed in to change notification settings - Fork 47
Description
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.
vsapi/Client/UI/ElementBounds.cs
Lines 799 to 801 in f7c6a7e
| public ElementBounds FixedUnder(ElementBounds refBounds, double spacing = 0) | |
| { | |
| fixedY += refBounds.fixedY + refBounds.fixedHeight + spacing; |
For reference here are the other similar functions,
vsapi/Client/UI/ElementBounds.cs
Lines 811 to 813 in f7c6a7e
| public ElementBounds FixedRightOf(ElementBounds refBounds, double leftSpacing = 0) | |
| { | |
| fixedX = refBounds.fixedX + refBounds.fixedWidth + leftSpacing; |
vsapi/Client/UI/ElementBounds.cs
Lines 823 to 825 in f7c6a7e
| 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.