[Drawkit] x-axis zooming?
Graham Cox
graham.cox at bigpond.com
Fri Jun 27 16:48:07 PDT 2008
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.
More information about the Drawkit
mailing list