RFR: 8321722: Tab header flickering when dragging slowly other tabs and reordering uncompleted
Jose Pereda
jpereda at openjdk.org
Mon Dec 11 19:07:33 UTC 2023
On Mon, 11 Dec 2023 19:01:19 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java line 2162:
>>
>>> 2160: }
>>> 2161: // Stop dropHeaderAnim if direction of drag is changed
>>> 2162: if (dragDirection != 0 && prevDragDirection != dragDirection) {
>>
>> Did you mean `dragDelta != 0`?
>
> it is sort of equivalent in this case...
> I think this code is correct.
It is the same as using `dragDelta != 0`, since `dragDelta = 0` implies `dragDirection = 0`.
The if-else expression doesn't provide a value for the case `dragDelta == 0`, so I've added an initial value 0 to `dragDirection`.
Since `prevDragDirection` initial value is -1, we need to verify that `dragDirection` is not zero and also `prevDragDirection` is different to `dragDirection` to detect a change of direction.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1304#discussion_r1423005976
More information about the openjfx-dev
mailing list