[Drawkit] x-axis zooming?

James Maxwell jbmaxwell at rubato-music.com
Fri Jun 27 16:59:01 PDT 2008


Ah, okay. Thanks, Graham.

I had been thinking that I might just set a sort of "xScale" variable  
by which all x positions would be multiplied when positioning objects,  
but I thought that seemed a bit too "manual"... if that makes any  
sense! But you're right, I don't want to stretch the graphical  
objects, just distribute their viewed positions across more horizontal  
space.

cheers,

J.



On 27-Jun-08, at 4:48 PM, Graham Cox wrote:

> I suspect that you probably don't want to simply zoom the graphics  
> in the x direction only. That would cause everything to stretch out  
> and become very distorted.
>
> Instead what will change is your time <--> x position ratio. I'm far  
> from familiar with music notation but let's say you had a system  
> where each time value (1/16th note, say) took  up 10 points.  
> Somewhere you will be doing calculations to place notes (and  
> everything else, like bar lines) at a certain position using this  
> ratio. By changing that ratio you will  allow "zooming" in the x  
> direction but without the graphics themselves changing size.
>
> From this is should be clear that you'll have to handle this  
> yourself. If you plan for it in your code that decides where to  
> place notes, it should be straightforward, but other than that I  
> can't really give very concrete advice.
>
> To implement graphical zooming which differs in x and y, you'd need  
> to subclass the DKDrawingView class but I really doubt that's what  
> you want.
>
> cheers, Graham
>
>
> On 28 Jun 2008, at 7:02 am, James Maxwell wrote:
>
>> Hello All,
>>
>> Anybody have any thoughts on implementing an x-axis only zoom?
>> I'm working on a music app interface, and this is a common  
>> requirement - "piano scroll" editors do this all the time, in order  
>> to clearly view notes in rapid passages, so everything won't be too  
>> tightly clumped together.
>>
>> thanks,
>>
>> J.
> _______________________________________________
> Drawkit mailing list
> Drawkit at lists.apptree.net
> http://lists.apptree.net/listinfo.cgi/drawkit-apptree.net



More information about the Drawkit mailing list