<div dir="ltr"><div dir="ltr">If I knew what the fix was I would have. Right now I'm not sure anymore what the correct behavior should be even.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 1, 2023 at 10:44 PM Andy Goryachev <<a href="mailto:andy.goryachev@oracle.com">andy.goryachev@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg8926601824139398286">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_8926601824139398286WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">Nir, would you like to submit a pull request?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">Thank you<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">-andy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">openjfx-dev <<a href="mailto:openjfx-dev-retn@openjdk.org" target="_blank">openjfx-dev-retn@openjdk.org</a>> on behalf of Nir Lisker <<a href="mailto:nlisker@gmail.com" target="_blank">nlisker@gmail.com</a>><br>
<b>Date: </b>Sunday, April 30, 2023 at 10:04<br>
<b>To: </b>openjfx-dev <<a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a>><br>
<b>Subject: </b>JDK-8199934: ScrollPaneSkin incorrectly lays out its scrollbars<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Hi,<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">I took a quick jab at this issue [1]. Using the reproducer in the ticket, launch and resize the stage vertically so that the buttons at the bottom are only partially visible.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">The current behavior is as follows:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">When the scrollbar is not needed, toggling to the AS_NEEDED policy reallocates the scrollbar space for the buttons (they move up).<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">When the scrollbar is needed, toggling to the AS_NEEDED policy still reallocates space, and the scrollbar takes away space from the content node. This is wrong.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11pt">I modified the method 'computeHsbSizeHint' to<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11pt">private double computeHsbSizeHint(ScrollPane sp) {<br>
return determineHorizontalSBVisible() ? hsb.prefHeight(ScrollBar.USE_COMPUTED_SIZE) : 0;<br>
}<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Now the policy toggling behavior is correct both when the scrollbar is needed and when it's not - the space is reallocated not at the expense of the content. However, enlarging the stage horizontally while
AS_NEEDED is selected does not reallocate the space (you need to toggle the policies). I'm guessing there's a missing call to layoutChildren during this resizing.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Does anyone have any input here?<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Thanks,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Nir<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">[1] <a href="https://bugs.openjdk.org/browse/JDK-8199934" target="_blank">
https://bugs.openjdk.org/browse/JDK-8199934</a><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div></blockquote></div></div>