forked from RepoMirrors/kami-blue
Merge branch 'master' of github.com:kami-blue/client
This commit is contained in:
commit
74bf828a85
|
@ -35,7 +35,7 @@ public class RootScrollpaneUI extends AbstractComponentUI<Scrollpane> {
|
||||||
component.addMouseListener(new MouseListener() {
|
component.addMouseListener(new MouseListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onMouseDown(MouseButtonEvent event) {
|
public void onMouseDown(MouseButtonEvent event) {
|
||||||
if (System.currentTimeMillis() - lastScroll < barLife && scrollComponent.liesIn(component) && component.canScrollY()) {
|
if (component.canScrollY()) {
|
||||||
double progress = (double) component.getScrolledY() / (double) component.getMaxScrollY();
|
double progress = (double) component.getScrolledY() / (double) component.getMaxScrollY();
|
||||||
int barHeight = 30;
|
int barHeight = 30;
|
||||||
int y = (int) ((component.getHeight() - barHeight) * progress);
|
int y = (int) ((component.getHeight() - barHeight) * progress);
|
||||||
|
@ -82,9 +82,9 @@ public class RootScrollpaneUI extends AbstractComponentUI<Scrollpane> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPostRender() {
|
public void onPostRender() {
|
||||||
if (dragBar)
|
|
||||||
lastScroll = System.currentTimeMillis();
|
lastScroll = System.currentTimeMillis();
|
||||||
if (System.currentTimeMillis() - lastScroll < barLife && scrollComponent.liesIn(component) && component.canScrollY()) {
|
|
||||||
|
if (component.canScrollY()) {
|
||||||
float alpha = Math.min(1, (barLife - (System.currentTimeMillis() - lastScroll)) / 100f) / 3f;
|
float alpha = Math.min(1, (barLife - (System.currentTimeMillis() - lastScroll)) / 100f) / 3f;
|
||||||
if (dragBar) alpha = 0.4f;
|
if (dragBar) alpha = 0.4f;
|
||||||
GL11.glColor4f(toF(GuiC.scrollBar.color.getRed()), toF(GuiC.scrollBar.color.getGreen()), toF(GuiC.scrollBar.color.getBlue()), alpha);
|
GL11.glColor4f(toF(GuiC.scrollBar.color.getRed()), toF(GuiC.scrollBar.color.getGreen()), toF(GuiC.scrollBar.color.getBlue()), alpha);
|
||||||
|
|
|
@ -51,16 +51,14 @@ public class Scrollpane extends OrganisedContainer {
|
||||||
public void onPreRender() {
|
public void onPreRender() {
|
||||||
translatex = scrolledX;
|
translatex = scrolledX;
|
||||||
translatey = scrolledY;
|
translatey = scrolledY;
|
||||||
//GL11.glTranslatef(-translatex, -translatey, 0);
|
|
||||||
int[] real = GUI.calculateRealPosition(Scrollpane.this);
|
int[] real = GUI.calculateRealPosition(Scrollpane.this);
|
||||||
int scale = DisplayGuiScreen.getScale();
|
int scale = DisplayGuiScreen.getScale();
|
||||||
GL11.glScissor(getX() * scale + real[0] * scale - ((Container) getParent()).getOriginOffsetX() - 1, Display.getHeight() - getHeight() * scale - real[1] * scale - 1, getWidth() * scale + ((Container) getParent()).getOriginOffsetX() * scale + 1, getHeight() * scale + 1);
|
GL11.glScissor(getX() * scale + real[0] * scale - getParent().getOriginOffsetX() - 1, Display.getHeight() - getHeight() * scale - real[1] * scale - 1, getWidth() * scale + getParent().getOriginOffsetX() * scale + 1, getHeight() * scale + 1);
|
||||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPostRender() {
|
public void onPostRender() {
|
||||||
//GL11.glTranslatef(translatex, translatey, 0);
|
|
||||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -175,14 +173,6 @@ public class Scrollpane extends OrganisedContainer {
|
||||||
return doScrollY;
|
return doScrollY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDoScrollY(boolean doScrollY) {
|
|
||||||
this.doScrollY = doScrollY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDoScrollX(boolean doScrollX) {
|
|
||||||
this.doScrollX = doScrollX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setScrolledX(int scrolledX) {
|
public void setScrolledX(int scrolledX) {
|
||||||
int a = getScrolledX();
|
int a = getScrolledX();
|
||||||
this.scrolledX = scrolledX;
|
this.scrolledX = scrolledX;
|
||||||
|
|
Loading…
Reference in New Issue