Add 't' button to toggle optional threading mode, TestPerformancePattern
[SugarCubes.git] / _UIFramework.pde
index 2b3d0470b5c9420d44199392aeab00b9f3892e80..ec590fef863e733c3b1fe335241d8ce43e60b544 100644 (file)
@@ -703,7 +703,7 @@ public class UIScrollList extends UIObject {
         itemColor = #707070;
       }
       float factor = even ? .92 : 1.08;
-      itemColor = color(hue(itemColor), saturation(itemColor), min(100, factor*brightness(itemColor)));
+      itemColor = lx.scaleBrightness(itemColor, factor);
       
       pg.noStroke();
       pg.fill(itemColor);
@@ -778,7 +778,7 @@ public class UIScrollList extends UIObject {
   }
   
   public void setScrollOffset(int offset) {
-    scrollOffset = constrain(offset, 0, items.size() - numVisibleItems);
+    scrollOffset = constrain(offset, 0, max(0, items.size() - numVisibleItems));
     scrollYStart = round(scrollOffset * h / items.size());
     scrollYHeight = round(numVisibleItems * h / items.size());
     redraw();