Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rafi0
Copy link
Contributor

@rafi0 rafi0 commented Feb 26, 2024

Fixes #2164

@soywiz
Copy link
Collaborator

soywiz commented Feb 26, 2024

Thanks! We will need to do the same for the rest, including UIHorizontalStack, etc.
Also we will need to add a test that verifies Y positions flor these views. And maybe a reference tests. Instead of texts, with solid rects that are less likely to fail due slight vector inconsistencies.

@soywiz
Copy link
Collaborator

soywiz commented Mar 1, 2024

Fixes #2164

Copy link
Collaborator

@soywiz soywiz left a comment

Choose a reason for hiding this comment

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

We need two things:

  • Update UIHorizontalStack too.
  • Add a test that checks the new behaviour.

My suggestion for the test is the following:

@Test
fun testUIVerticalStack() {
  val stack = UIVerticalStack()
  val view1 = stack.solidRect(10, 10, Colors.RED)
  val view2 = stack.graphics { fill(Colors.RED) { rect(10, 10, 20, 20) } }
  val view3 = stack.solidRect(10, 10, Colors.RED)
  stack.relayout()
  assertEquals("...", "${view1.y.niceStr},${view2.y.niceStr},${view3.y.niceStr}")
}

By applying/reverting this change the view3.y should be different. So that will cover that we have fixed the issue.

@rafi0 rafi0 requested a review from soywiz March 25, 2024 17:46
Copy link
Collaborator

@soywiz soywiz left a comment

Choose a reason for hiding this comment

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

LGTM

@soywiz soywiz merged commit 387fa55 into korlibs:main Mar 26, 2024
@soywiz
Copy link
Collaborator

soywiz commented Mar 26, 2024

Thank you very much!

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.

graphics{} on uiVerticalStack is not checking bounds

2 participants