Bug 188081

Summary: ScrollBar rendered incorrectly when the range model contains large numbers
Product: [Tools] GEF Reporter: fictivy
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P4 CC: nyssen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
code example
none
Patch to increase range of scrollbar values none

Description fictivy CLA 2007-05-21 08:40:30 EDT
Build ID: 3.2.2

Create a scrollbar with e.g. 
minimum:  -50000000
maximum:   50000000
value: 0
The thumb will not be drawn in the middle but over the up arrow button. It cannot be dragged to the middle either.
Comment 1 fictivy CLA 2007-05-21 08:41:50 EDT
Created attachment 67973 [details]
code example
Comment 2 Randy Hudson CLA 2007-05-21 09:32:30 EDT
Would you care to provide a patch to this problem? 50 million is a very large number and well beyond what most GEF clients are trying to display, so this would receive low priority from the GEF team.
Comment 3 Matt Scarpino CLA 2007-08-14 11:44:17 EDT
Created attachment 76053 [details]
Patch to increase range of scrollbar values

The location of the scrollbar thumb is currently calculated using integer math. When the integers become too large, overflow causes unpredictable results. This patch increases the range of possible values by replacing the integer math with floating-point calculations and rounding.

These floating-point calculations increase the range of possible scrollbar values, but it's questionable whether the increased range is worth the additional processing time.