Made calculation of Markers on GuiTimeline dynamic

Changed Real Timeline's Length to 30 minutes (request by multiple users)
This commit is contained in:
CrushedPixel
2015-07-19 23:27:15 +02:00
parent 6422558028
commit 702e02db65
5 changed files with 102 additions and 47 deletions

View File

@@ -137,7 +137,7 @@ public class GuiScrollbar extends Gui implements GuiElement {
int backgroundBodyWidth = width - BORDER_LEFT - BORDER_RIGHT;
int bodyLeft = positionX + SLIDER_BORDER_LEFT;
int bodyRight = positionX + (int) Math.round(backgroundBodyWidth * size) - SLIDER_BORDER_RIGHT;
int bodyRight = positionX + Math.max(1, (int) Math.round(backgroundBodyWidth * size) - SLIDER_BORDER_RIGHT);
// Left border
rect(positionX, positionY, SLIDER_TEXTURE_X, SLIDER_TEXTURE_Y, SLIDER_BORDER_LEFT, SLIDER_HEIGHT);
@@ -172,7 +172,7 @@ public class GuiScrollbar extends Gui implements GuiElement {
public boolean isHovering(int mouseX, int mouseY) {
int offsetX = getSliderOffsetX();
int minX = positionX + offsetX;
int maxX = positionX + offsetX + (int) (width * size);
int maxX = positionX + offsetX + Math.max(3, (int) (width * size));
int minY = positionY + BORDER_TOP;
int maxY = minY + SLIDER_HEIGHT;
return mouseX >= minX && mouseY >= minY && mouseX < maxX && mouseY < maxY;