From: Vincent S. <sc...@sa...> - 2005-06-15 09:21:32
|
Hi all, Mario, On Tue, 2005-06-14 at 14:28 -0400, Mario Beauchamp wrote: > Hi Vincent, > > Vincent Schut wrote: > > > > Somewhere there seems to be a rounding of the float value, or > > some conversion to int... > > The rounding happens in the slider itself. To get more digits, add these lines to > GvRasterSource.__init__: > > self.min_slider.set_digits(ndigits) > self.max_slider.set_digits(ndigits) > > where ndigits is the number of digits you want. > > There's info on this at http://www.pygtk.org/pygtktutorial/sec-scalewidgets.html > Indeed this appeared the heart of the problem. Attached is a proposed patch for pymod/gvrasterpropdlg.py which will automatically increase the number of digits for the gtk sliders when a floating point raster is loaded. For integer rasters, the number of digits is set to 0. As far as I have tested it now, it seems to resolve all problems that were reported with those sliders when used with floating point rasters with relatively small value ranges. Regards, Vincent. |