Size: a a a

2021 January 03

AM

Azure Mynn in pro.algorithms
Like this
источник

MG

Matthew Good in pro.algorithms
hm ok
источник

MG

Matthew Good in pro.algorithms
so this?

public void updatePosition(int dx, int dy) {
   documentScrollX += dx;
   documentScrollY += dy;
   if (!scrolling) scrollThumb();
}

float multiplier2 = 0.0f;
float scrollBarPosition = 0.0f;

void scrollThumb() {
   // the absolute position is only updated when the scrollbar itself
   // gets scrolled by the touch listener
   // so use documentScrollY instead, which is equivilant in that
   // it is maintained by a callback from the document view
   // specifying relative scroll direction
   multiplier2 = documentScrollY / (documentHeight - windowHeight);
   scrollBarPosition = clip.getY();
   scrollBarPosition = multiplier2 * (getHeight() - scrollBarPosition);
   clip.setY(scrollBarPosition);
}
источник

AM

Azure Mynn in pro.algorithms
Yeah, but what is the clip.getY() for
источник

MG

Matthew Good in pro.algorithms
that is the scroll bar position
источник

AM

Azure Mynn in pro.algorithms
Oh, wait, nevermind, it's supposed to be scroll height
источник

AM

Azure Mynn in pro.algorithms
I just copypasted the old one lol
источник

MG

Matthew Good in pro.algorithms
so scroll height - scroll height? xP
источник

MG

Matthew Good in pro.algorithms
or multiplier2 * scrollHeight ?
источник

AM

Azure Mynn in pro.algorithms
Matthew Good
so scroll height - scroll height? xP
Naah
источник

MG

Matthew Good in pro.algorithms
which im not sure makes sence, depending on if multiplier2 is also a value between 0 and 1, or if it can exceed 1
источник

AM

Azure Mynn in pro.algorithms
scrollBarPosition = multiplier2 * (getHeight() - scrollThumbHeight);
источник

AM

Azure Mynn in pro.algorithms
Like this
источник

MG

Matthew Good in pro.algorithms
oh ok
источник

MG

Matthew Good in pro.algorithms
then scrollBarPosition = multiplier2 * (getHeight() - clip.getHeight()); 🙂
источник

AM

Azure Mynn in pro.algorithms
Yup
источник

AM

Azure Mynn in pro.algorithms
I guess that
источник

MG

Matthew Good in pro.algorithms
oo yay it works now 🙂
источник

AM

Azure Mynn in pro.algorithms
Nicee
источник

MG

Matthew Good in pro.algorithms
thanks ^~^
источник