RFR: 8311527: Region.snapInnerSpace*() [v2]
Andy Goryachev
angorya at openjdk.org
Thu Sep 7 22:19:45 UTC 2023
On Thu, 7 Sep 2023 16:41:23 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> Introduces Region.snapInnerSpaceX/Y() methods for dealing with inner space (using Math.floor), see for instance [JDK-8299753](https://bugs.openjdk.org/browse/JDK-8299753), using existing methods Region.snapPortionX/Y().
>
> Andy Goryachev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
>
> - review comments
> - Merge remote-tracking branch 'origin/master' into ag.8311527.snap.inner
> - tests
> - Merge remote-tracking branch 'origin/master' into ag.8311527.snap.inner
> - javadoc
> - snap portion
> - cleanup
> - 8311527: snap inner space
I see at least two use cases:
1. When laying out an unsnapped container which contains snapped children. In order to get the available (snapped) space, we'd need to floor the unsnapped size.
2. When laying out a complex constraint layout, such as a variant of TableLayout (see for example https://github.com/andy-goryachev/FxDock/blob/master/doc/CPane.md ), where there might exist external constraints on one or more columns and/or rows, there might be a need to snap the constraint value. How it needs to be snapped depends on the actual constraint, for example when we have a **maximum width** constraint in an otherwise unconstrained situation, we need snapInnerSpace().
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1190#issuecomment-1710832371
More information about the openjfx-dev
mailing list