[Plib-devel] [PATCH] puaLargeInput: don't move text to the right when increasing width
Brought to you by:
sjbaker
From: Melchior F. <mf...@us...> - 2009-02-09 12:54:25
|
Hi, here's a fix for a bug that slipped through: if one increased the widget width beyond the width of the longest line, then the slider did (correctly) disappear, but from then on the text moved to the left. We have to reset the slider to the leftmost position then. m. diff --git a/src/puAux/puAuxLargeInput.cxx b/src/puAux/puAuxLargeInput.cxx index 34fef07..c39a6b9 100644 --- a/src/puAux/puAuxLargeInput.cxx +++ b/src/puAux/puAuxLargeInput.cxx @@ -170,11 +170,14 @@ void puaLargeInput::updateGeometry ( void ) // horizontal slider if ( bottom_slider ) { bottom_slider->setSize ( w - ( slider & VERTICAL ? slider_width : 0 ), slider_width ) ; - bottom_slider->setSliderFraction ( float(input_width) / max_width ) ; float page_step = 1.0f, line_step = 1.0f ; if ( max_width > input_width ) { page_step = float(input_width) / ( max_width - input_width ) ; line_step = legendFont.getFloatStringWidth( "M" ) / ( max_width - input_width ) ; + bottom_slider->setSliderFraction ( float(input_width) / max_width ) ; + } else { + bottom_slider->setSliderFraction ( 1.0f ) ; + bottom_slider->setValue ( 0.0f ); } bottom_slider->setPageStepSize ( page_step ) ; |