On Thu, 10 Nov 2022 20:28:39 GMT, Marius Hanl <mh...@openjdk.org> wrote:
>> I still think this code is incorrect. >> >> To illustrate, let's set insets to 0.8 and anchor to 0.5 >> Here is what I think it should do: >> snap=off >> result=1.3 >> >> snap=on >> result=1.0 (and not 1.5, as I think the proposed fix would produce) > > I also never understood that completely. > Hence I asked at the mailing list about snapping in the past: > https://mail.openjdk.org/pipermail/openjfx-dev/2021-September/032166.html > In my opinion it also makes sense to snap the values once. But that would be > a huge refactoring and everything is affected. We can not just change this > now. Thats why I would stick to the existing solution and refactor that later. > But some clarification here would be helpful here, maybe ask the people who > created this (if available)?. And I haven't looked yet, but how does Swing > handle this? It's seems little tricky to choose an approach for this fix. - NOT snapping intermediate values (new approach): 1. It definitely seems correct NOT to snap intermediate values. 2. But currently, code Controls snap the intermediate values, 3. This PR seems to be the first change of snapping in a layout: => Will it regress if we have different approach in layout than in control ? I think No, It won’t regress. @Maran23 Can you please try it with this fix ? In that case, we can adapt the new way for layout and file a new JBS to refactor existing code. ------------- PR: https://git.openjdk.org/jfx/pull/910