Skip to content

fix: #5343 陶瓦联机界面账号快速切换列表右侧滚动条错位以及列表莫名抽搐 #6109

Open
CiiLu wants to merge 2 commits into
HMCL-dev:mainfrom
CiiLu:svjjvjrngfbdsgf-
Open

fix: #5343 陶瓦联机界面账号快速切换列表右侧滚动条错位以及列表莫名抽搐 #6109
CiiLu wants to merge 2 commits into
HMCL-dev:mainfrom
CiiLu:svjjvjrngfbdsgf-

Conversation

@CiiLu
Copy link
Copy Markdown
Contributor

@CiiLu CiiLu commented May 16, 2026

fixes #5343

@Glavo
Copy link
Copy Markdown
Member

Glavo commented May 18, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the AccountListPopupMenu to reset the vertical scroll position of the account list whenever the list is invalidated. A review comment correctly identified that using Double.MIN_VALUE to reset the scroll position is semantically incorrect, as it represents the smallest positive non-zero value rather than zero, and suggested using 0.0 for better clarity and correctness.

box.add(item);
}

Platform.runLater(() -> box.setVvalue(Double.MIN_VALUE));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using Double.MIN_VALUE to reset the scroll position is semantically incorrect. In Java, Double.MIN_VALUE is the smallest positive non-zero value ($4.9 \times 10^{-324}$), not the minimum possible value (which would be -Double.MAX_VALUE). For a ScrollPane's vvalue, the valid range is typically 0.0 to 1.0. While Double.MIN_VALUE is effectively 0.0 due to precision, it is clearer and more idiomatic to use 0.0 or box.getVmin().

Suggested change
Platform.runLater(() -> box.setVvalue(Double.MIN_VALUE));
Platform.runLater(() -> box.setVvalue(0.0));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 陶瓦联机界面账号快速切换列表右侧滚动条错位以及列表莫名抽搐

2 participants