[racket] reason for limit of 1M on virtual canvas size?

From: John Clements (clements at brinckerhoff.org)
Date: Mon Mar 24 21:11:31 EDT 2014

On Mar 24, 2014, at 6:03 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:

> On some platforms, I think that value goes into a 32-bit float and
> back. All of the integers up to 1M can be represented by a 32-bit
> float, and if I'm counting right, 1M is the largest power of 10 with
> that property.
> 

Ah… floats. I thought of 32-bit ints, but not of 32-bit floats. I’ll add a dialog that suggests drawing only a portion of the sound to allow further zooming.

Thanks,

John 


> At Mon, 24 Mar 2014 17:27:06 -0700, John Clements wrote:
>> Currently, calling ‘init-auto-scrollbars’ with a virtual canvas size larger 
>> than a million signals a contract error:
>> 
>> ../draw.rkt:231:6: init-auto-scrollbars in canvas%: contract violation
>>  expected: (integer-in 1 1000000)
>>  given: 1638400
>> 
>> This arises when scrolling through zoomed-in sounds using ‘rsound’. The limit 
>> of 1M along with the standard sample rate of 44.1KHz means that you can’t zoom 
>> in to 1 sample per pixel on sounds longer than 22 seconds.
>> 
>> It seems reasonable to me that there should be some limit, and that I’ll have 
>> to check for it either way, but in this case, it seems like the 1M limit could 
>> perhaps be raised without ill effect. Maybe 100M?
>> 
>> Looking at the docs, I see that there’s the notion of a ‘dimension-integer’ 
>> that’s fairly pervasive. In this case, I can see that changing this might 
>> impact the scroll-thumb-size computation, and possibly the “page left/page 
>> right” computation.
>> 
>> John Clements
>> ____________________
>>  Racket Users list:
>>  http://lists.racket-lang.org/users



Posted on the users mailing list.