On Wed, 5 Jul 2023 20:31:09 GMT, Michael Strauß <mstra...@openjdk.org> wrote:
>> Modified the resize algorithm to work well with fractional scale, thanks for >> deeper understanding of the problem thanks to @hjohn and @mstr2 . >> >> Removed earlier manual tester in favor of the monkey tester. >> >> It is important to note that even though the constraints are given by the >> user in unsnapped coordinates, they are converted to snapped values, since >> the snapped values correspond to the actual pixels on the display. This >> means the tests that validate honoring constraints should, in all the cases >> where (scale != 1.0), assume possibly error not exceeding (1.0 / scale). > > I agree with John that a layout algorithm that uses incremental calculations > will always be flawed in principle. The correct approach is to store the > initial configuration, and then for each configuration change, go back to the > initial configuration and recompute the layout solution. > > Now, we might still accept a bugfix for a flawed algorithm. But JDK-8299753 > is an enhancement, not a bugfix. I'm not sure what to make of this: it's > obviously a flawed approach, and basing an enhancement on a flawed approach > means that someone would have to come back to this issue in the future and > solve it correctly. > > I don't think that the issue at hand is so severe that it's a forced move to > integrate this interim solution. > I respectfully disagree, @mstr2 . > > This fix is not an interim solution - unlike any theoretical considerations > of "flawed approach", in practice this code does work as expected with > integer and fractional scales, and, given our situation, it's highly unlikely > that any alternative solutions will ever be considered, especially those that > would affect existing public APIs. It isn't just a theoretical issue. The proposed patch fails to keep the divider precisely at the cursor location, depending on frame rate and mouse movement speed. This is how the behavior manifests on my machine: https://github.com/openjdk/jfx/assets/43553916/79cf04be-bd18-4cfe-9c34-912978ee96ee ------------- PR Comment: https://git.openjdk.org/jfx/pull/1156#issuecomment-1622726851