Bug 188081 - ScrollBar rendered incorrectly when the range model contains large numbers
Summary: ScrollBar rendered incorrectly when the range model contains large numbers
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-21 08:40 EDT by fictivy CLA
Modified: 2015-01-22 02:37 EST (History)
1 user (show)

See Also:


Attachments
code example (973 bytes, application/octet-stream)
2007-05-21 08:41 EDT, fictivy CLA
no flags Details
Patch to increase range of scrollbar values (1.66 KB, patch)
2007-08-14 11:44 EDT, Matt Scarpino CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.