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

Pos.Bottom returns PosCombine (+0) #3064

Closed
tznind opened this issue Dec 19, 2023 · 1 comment
Closed

Pos.Bottom returns PosCombine (+0) #3064

tznind opened this issue Dec 19, 2023 · 1 comment
Labels
v2 For discussions, issues, etc... relavant for v2

Comments

@tznind
Copy link
Collaborator

tznind commented Dec 19, 2023

Describe the bug

Calling Pos.Bottom is not returning the correct (simplest) Pos.

It is returning

Pos.Combine(Pos.View(side=bottom, target=View()({X=0,Y=0,Width=0,Height=0}))+Pos.Absolute(0))

Instead of

Pos.View(side=bottom, target=View()({X=0,Y=0,Width=0,Height=0}))

Here is a unit test which currently fails on v2:

[Fact]
public void DoNotReturnPosCombine()
{
var v = new View ();
var pos = Pos.Bottom (v);

Assert.Equal (
	"Pos.View(side=bottom, target=View()({X=0,Y=0,Width=0,Height=0}))",
	pos.ToString ());
}

Additional context
While adding + 0 doesn't cause any behaviour in client apps it is still confusing. Additionally it causes issues with TerminalGuiDesigner which really wants to know if a View currently has relative, absolute etc positioning.

@tznind tznind added the v2 For discussions, issues, etc... relavant for v2 label Dec 19, 2023
@BDisp
Copy link
Collaborator

BDisp commented Dec 19, 2023

In this case all them (X, Y, Left, Top, Right, Bottom) are wrong as well because they all return PosCombine(Pos.View(), Pos.Absolute(0))

BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Dec 19, 2023
@tig tig closed this as completed Dec 20, 2023
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 For discussions, issues, etc... relavant for v2
Projects
None yet
Development

No branches or pull requests

3 participants