Fix off-by-one slider bug

slava 2006-05-31 21:17:31 +00:00
parent 0933402e5b
commit e15fe7b092
2 changed files with 3 additions and 5 deletions

View File

@ -17,8 +17,7 @@
restores to an unresponsive gadget
- fix top level window positioning
- services do not launch if factor not running
- when scrolling wheel, or moving mouse out of window, rollover is not
updated
- rollover is not updated on focus changes
- amd64 crash
- get factor running on mac intel
- constant branch folding
@ -62,7 +61,6 @@
- x11 input methods
- roundoff is still not quite right with tracks
- clearing pane with ^L leaves scrollbar a pixel off
- new browser:
- browse generic words and classes
- need actions for reloading the source file and opening word in jEdit

View File

@ -25,14 +25,14 @@ TUPLE: slider elevator thumb value saved max page ;
dup slider-page over slider-max 1 max / 1 min
swap elevator-length * min-thumb-dim max ;
: slider-max* dup slider-max swap slider-page - 1 max ;
: slider-max* dup slider-max swap slider-page - 0 max ;
: slider-scale ( slider -- n )
#! A scaling factor such that if x is a slider co-ordinate,
#! x*n is the screen position of the thumb, and conversely
#! for x/n. The '1 max' calls avoid division by zero.
dup elevator-length over thumb-dim - 1 max
swap slider-max* / ;
swap slider-max* 1 max / ;
: slider>screen slider-scale * ;