mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 17:03:12 +07:00
TreeUtil#getVisibleRowCount optimized when tree has fixed row height (part of IDEA-192253)
GitOrigin-RevId: 67582bd2de96717410baa898836465c18027daa3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2dc5dc9ae9
commit
fe1e4b820b
@@ -720,6 +720,13 @@ public final class TreeUtil {
|
||||
|
||||
if (visible == null) return 0;
|
||||
|
||||
int rowHeight = tree.getRowHeight();
|
||||
if (rowHeight > 0) {
|
||||
int firstRow = visible.y / rowHeight;
|
||||
int lastRow = (visible.y + visible.height) / rowHeight;
|
||||
return lastRow - firstRow + 1;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (int i=0; i < tree.getRowCount(); i++) {
|
||||
final Rectangle bounds = tree.getRowBounds(i);
|
||||
|
||||
Reference in New Issue
Block a user