X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjexer%2FTVScroller.java;h=9b69f691593a4ed0ae9c78d65039eb968c40b0d7;hb=3649b9210ea425f398ba8c24f9509669cf72aa96;hp=d9d5ec852bb1495c7ce4fed35a9498f7d4ab1775;hpb=06fc796900585f16a4962fb76c13e25a7cf937eb;p=fanfix.git diff --git a/src/jexer/TVScroller.java b/src/jexer/TVScroller.java index d9d5ec8..9b69f69 100644 --- a/src/jexer/TVScroller.java +++ b/src/jexer/TVScroller.java @@ -1,4 +1,4 @@ -/** +/* * Jexer - Java Text User Interface * * License: LGPLv3 or later @@ -158,12 +158,7 @@ public final class TVScroller extends TWidget { final int height) { // Set parent and window - super(parent); - - setX(x); - setY(y); - setHeight(height); - setWidth(1); + super(parent, x, y, 1, height); } /** @@ -333,13 +328,14 @@ public final class TVScroller extends TWidget { return; } - if ((mouse.getMouse1()) && - (inScroll) && - (mouse.getY() > 0) && - (mouse.getY() < getHeight() - 1) + if ((mouse.isMouse1()) + && (inScroll) + && (mouse.getY() > 0) + && (mouse.getY() < getHeight() - 1) ) { // Recompute value based on new box position - value = (bottomValue - topValue) * (mouse.getY()) / (getHeight() - 3) + topValue; + value = (bottomValue - topValue) + * (mouse.getY()) / (getHeight() - 3) + topValue; return; }