MCPcopy Create free account
hub / github.com/BaseXdb/basex / scroll

Method scroll

basex-core/src/main/java/org/basex/gui/text/TextPanel.java:669–677  ·  view source on GitHub ↗

Scrolls to the specified position. @param y new vertical position @param align alignment (0: scroll up, 1: jump, 2: scroll down)

(final int y, final int align)

Source from the content-addressed store, hash-verified

667 * @param align alignment (0: scroll up, 1: jump, 2: scroll down)
668 */
669 private void scroll(final int y, final int align) {
670 if(y != -1) {
671 final int h = getHeight(), m = y + (rend.fontHeight() << 1) - h, p = scroll.pos();
672 if(p < m || p > y) {
673 scroll.pos(align == 0 ? y : align == 1 ? y - h / 2 : m);
674 }
675 }
676 rend.repaint();
677 }
678
679 /** Last horizontal position. */
680 private int lastCol = -1;

Callers 2

jumpMethod · 0.95
executeMethod · 0.95

Calls 2

fontHeightMethod · 0.80
posMethod · 0.45

Tested by

no test coverage detected