mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Prevent cards scrolling off screen after zooming
This commit is contained in:
@@ -255,15 +255,6 @@ public class MatchScreen extends FScreen {
|
||||
float yAfter = y * ratio;
|
||||
setScrollTop(oldScrollTop + yAfter - y);
|
||||
|
||||
//make scroll panes wide enough to support scrolling cards into view
|
||||
zoom = newScrollHeight / (getHeight() - staticHeight);
|
||||
for (FScrollPane scrollPane : horzScrollPanes.keySet()) {
|
||||
float minScrollWidth = scrollPane.getWidth() * zoom;
|
||||
if (scrollPane.getScrollWidth() < minScrollWidth) {
|
||||
scrollPane.setScrollWidth(minScrollWidth);
|
||||
}
|
||||
}
|
||||
|
||||
//adjust scroll left of all horizontal scroll panes to keep x position the same
|
||||
float startX = x;
|
||||
for (Entry<FScrollPane, Pair<Float, Float>> entry : horzScrollPanes.entrySet()) {
|
||||
|
||||
@@ -40,18 +40,10 @@ public abstract class FScrollPane extends FContainer {
|
||||
return scrollBounds.width;
|
||||
}
|
||||
|
||||
public void setScrollWidth(float scrollWidth0) {
|
||||
scrollBounds.width = scrollWidth0;
|
||||
}
|
||||
|
||||
public float getScrollHeight() {
|
||||
return scrollBounds.height;
|
||||
}
|
||||
|
||||
public void setScrollHeight(float scrollHeight0) {
|
||||
scrollBounds.height = scrollHeight0;
|
||||
}
|
||||
|
||||
public float getMaxScrollLeft() {
|
||||
return getScrollWidth() - getWidth();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user