On Sat, 5 Sep 2026 11:42:14 GMT, Michael Strauß <[email protected]> wrote:
>> This PR is an audit of several snapping-related methods in `Region`, along >> with some bug fixes. >> >> I've added a helper method `snapAligned()`, which does the exact same thing >> as `snapSpace()`, but clearly states that the author knows that the value is >> already pixel-aligned. In addition, I've renamed several local variables >> around a "rawFoo" and "snappedFoo" naming scheme, so as to make it easier to >> see what's what. >> >> This PR should probably be integrated before the other layout container PRs, >> because those use the `Region` layout methods. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Michael Strauß has updated the pull request incrementally with one additional > commit since the last revision: > > review comments modules/javafx.graphics/src/main/java/javafx/scene/layout/Region.java line 2122: > 2120: > 2121: double rawChildPrefWidth = boundedSize(child.minWidth(alt), > child.prefWidth(alt), child.maxWidth(alt)); > 2122: return snapAligned(snappedLeft + snappedRight + > snapSize(rawChildPrefWidth, snap, scaleX), snap, scaleX); Minor: Also here, would look a bit easier to parse when the result of `snapSize` is assigned before to a variable ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2278#discussion_r3945187482
