forked from Kolyah35/minecraft-pe-0.6.1
Merge remote-tracking branch 'refs/remotes/origin/main'
This commit is contained in:
@@ -548,6 +548,14 @@ void ScrollingPane::stepThroughDecelerationAnimation(bool noAnimation) {
|
||||
}
|
||||
}
|
||||
|
||||
void ScrollingPane::scrollBy(float dx, float dy) {
|
||||
// adjust the translation offsets fpx/fpy by the requested amount
|
||||
float nfpx = fpx + dx;
|
||||
float nfpy = fpy + dy;
|
||||
// convert back to content offset (fpx = -contentOffset.x)
|
||||
setContentOffset(Vec3(-nfpx, -nfpy, 0));
|
||||
}
|
||||
|
||||
void ScrollingPane::setContentOffset(float x, float y) {
|
||||
this->setContentOffsetWithAnimation(Vec3(x, y, 0), false);
|
||||
}
|
||||
|
||||
@@ -51,6 +51,10 @@ public:
|
||||
void tick();
|
||||
void render(int xm, int ym, float alpha);
|
||||
|
||||
// scroll the content by the given amount (dx horizontal, dy vertical)
|
||||
// positive values move content downward/rightward
|
||||
void scrollBy(float dx, float dy);
|
||||
|
||||
bool getGridItemFor_slow(int itemIndex, GridItem& out);
|
||||
|
||||
void setSelected(int id, bool selected);
|
||||
|
||||
Reference in New Issue
Block a user