MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / fitCursorByTop

Method fitCursorByTop

src/main/java/ui/VirtualList.java:712–737  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

710 }
711
712 protected synchronized void fitCursorByTop() {
713 if (cursor >= itemLayoutY.length)
714 cursor = itemLayoutY.length - 1;
715 int top = itemLayoutY[cursor];
716 if (top < win_top) {
717 win_top = top;
718 }
719
720 Object o = getFocusedObject();
721 if (o == null) {
722 return;
723 }
724
725 if (((VirtualElement) o).getVHeight() <= winHeight) {
726 if ((cursor + 1) < itemLayoutY.length) {
727 int bottom = itemLayoutY[cursor + 1] - winHeight;
728 if (bottom > win_top) {
729 win_top = bottom;
730 }
731 }
732 }
733
734 if (top >= win_top + winHeight) {
735 win_top = top;
736 }
737 }
738
739 protected void fitCursorByBottom() {
740 if ((cursor + 1) < itemLayoutY.length) {

Callers 4

eventOkMethod · 0.95
paintMethod · 0.95
pageLeftMethod · 0.95
pageRightMethod · 0.95

Calls 2

getFocusedObjectMethod · 0.95
getVHeightMethod · 0.65

Tested by

no test coverage detected