sojamo / controlp5

A gui library for processing.org
GNU Lesser General Public License v2.1
490 stars 142 forks source link

Wrong label position on vertical slider if aligned to BOTTOM_OUTSIDE #158

Open JKFennis opened 5 years ago

JKFennis commented 5 years ago

int sliderHeight = 200;
// add a vertical slider cp5.addSlider("slider") .setPosition(100,305) .setSize(20,sliderHeight) .setRange(0,200) .setValue(128) ;

// reposition the Label for controller 'slider' cp5.getController("slider").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE);

Adding a vertical padding the length of slider seems to work as workaround: cp5.getController("slider").getValueLabel().align(ControlP5.LEFT, ControlP5.BOTTOM_OUTSIDE).setPaddingY(-sliderHeight);