# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1303472610 0 # Node ID 0ac67b62b594f0eeebcc72aae31e210e76d90285 # Parent 07f9a73c68474084addde22023581f360b666d5c Fix int to double conversion issues causing scrollbar issues on Mac. Use double internally for all calculations...only cast to int when talking to the API. diff -r 07f9a73c6847 -r 0ac67b62b594 mac/dw.m --- a/mac/dw.m Fri Apr 22 11:01:25 2011 +0000 +++ b/mac/dw.m Fri Apr 22 11:43:30 2011 +0000 @@ -1073,10 +1073,10 @@ -(void)scrollerChanged:(id)sender { double proportion = [self knobProportion]; - int page = (int)(proportion * range); - int max = (int)(range - page); - int result = (int)([self doubleValue] * max); - int newpos = result; + double page = (proportion * range); + double max = (range - page); + double result = ([self doubleValue] * max); + double newpos = result; switch ([sender hitPart]) { @@ -1116,10 +1116,9 @@ } if(newpos != result) { - double newposd = (double)newpos/max; - [self setDoubleValue:newposd]; - } - _event_handler(self, (void *)newpos, 14); + [self setDoubleValue:(newpos/max)]; + } + _event_handler(self, (void *)(int)newpos, 14); } -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; } @end