One more "Giant Canvas" question 
Author Message
 One more "Giant Canvas" question

Okay,

I am re tooling the graphics display of my audio track sheet program but one
thing still baffles me.  Joe S. wrote the following.

Quote:
>Yes, the full drawing is 108000 pixels wide, but you're only drawing a
>small subset of this at any point in time, right?  Maybe the scroll
>position is 82050, and your canvas is 1000 pixels wide, so you're only
>drawing frames 82050 - 83050.  The key is, you subtract 82050 from all
>of your coordinates before drawing, so the range of arguments to your
>drawing commands is 0-1000.

but how do you get to 82050 (for example) if your scroll bar only goes to
32,797.  Everything else I think I understand and I am simplifying my code.
Thanks for all your help.

Joel



Sun, 09 Oct 2005 03:24:51 GMT  
 One more "Giant Canvas" question

Quote:

> I am re tooling the graphics display of my audio track sheet program but one
> thing still baffles me.  Joe S. wrote the following.

> >Yes, the full drawing is 108000 pixels wide, but you're only drawing a
> >small subset of this at any point in time, right?  Maybe the scroll
> >position is 82050, and your canvas is 1000 pixels wide, so you're only
> >drawing frames 82050 - 83050.  The key is, you subtract 82050 from all
> >of your coordinates before drawing, so the range of arguments to your
> >drawing commands is 0-1000.

> but how do you get to 82050 (for example) if your scroll bar only goes to
> 32,797.

Ah.  You define each increment of your scroll bar to be more than one
pixel.  Do people really *need* to be able to scroll by a single pixel
anyway?  Perhaps each scrollbar increment should 5 pixels, or 10.  Pick
an appropriate scroll scale, and just multiply the scrollbar value by
that to find the scroll position.

Cheers,
- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Sun, 09 Oct 2005 04:24:24 GMT  
 One more "Giant Canvas" question


Quote:


>> I am re tooling the graphics display of my audio track sheet program but one
>> thing still baffles me.  Joe S. wrote the following.

>>> Yes, the full drawing is 108000 pixels wide, but you're only drawing a
>>> small subset of this at any point in time, right?  Maybe the scroll
>>> position is 82050, and your canvas is 1000 pixels wide, so you're only
>>> drawing frames 82050 - 83050.  The key is, you subtract 82050 from all
>>> of your coordinates before drawing, so the range of arguments to your
>>> drawing commands is 0-1000.

>> but how do you get to 82050 (for example) if your scroll bar only goes to
>> 32,797.

> Ah.  You define each increment of your scroll bar to be more than one
> pixel.  Do people really *need* to be able to scroll by a single pixel
> anyway?  Perhaps each scrollbar increment should 5 pixels, or 10.  Pick
> an appropriate scroll scale, and just multiply the scrollbar value by
> that to find the scroll position.

> Cheers,
> - Joe

> ,------------------------------------------------------------------.
> |    Joseph J. Strout         Check out the Mac Web Directory:     |

> `------------------------------------------------------------------'

Cool.  That is actually what I did but I wasn't sure if that was the
"correct" way.  I have run across a strange phenom.  I haven't "limited" the
size of my scroll yet so it is always at maximum.  If I use my zoom at all,
The graphics will actually redraw again further down the canvas!  I really
don't see how that is possible as the math would put the sound file
representation way out of bounds.

Strange...

Joel



Sun, 09 Oct 2005 04:43:20 GMT  
 One more "Giant Canvas" question

Quote:

> If I use my zoom at all,
> The graphics will actually redraw again further down the canvas!  I really
> don't see how that is possible as the math would put the sound file
> representation way out of bounds.

Do you start at 0 or 1?
-laz


Sun, 09 Oct 2005 04:59:10 GMT  
 One more "Giant Canvas" question


Quote:


>> If I use my zoom at all,
>> The graphics will actually redraw again further down the canvas!  I really
>> don't see how that is possible as the math would put the sound file
>> representation way out of bounds.

> Do you start at 0 or 1?
> -laz

I start with 1 and go to 100.  It is strange really.  One of my files when
the zoom is set to 77 and above, it draws really wacky, but 76 and below it
draws correctly.

Joel



Sun, 09 Oct 2005 06:18:46 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Canvas "scale" question

2. "Some questions on canvases"

3. "Fastest" one-on-one file update

4. beginners "let"/"random" question

5. Hi, this code: text0 = "One $BLAH Three" text1 = "One @BLAH Three" text0.sub!("$BLAH", "Two") text1.sub!("@BLAH", "Two") print text0,"\n" print text1,"\n" produces thiHi, this code: text0 = "One $BLAH Three" text1 = "One @BLAH Three" text0.sub!("$BLAH", "T

6. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

7. BEGIN{want[]={"s1o", "s2o", "s2q", "s3q"}

8. bind to a "canvas create" object

9. canvas "droppings" on windows

10. Problem with "rectangle" on canvas

11. tk canvas "speed limit"?

12. seg fault on command "$canvas postscript"

 

 
Powered by phpBB® Forum Software