[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] relative coordinates in SCUserView




On 11.12.2007, at 12:39, thor wrote:


On 11 Dec 2007, at 10:39, Jan Trutzschler wrote:

getting the normalized position is fairly simple. it would like this:

: ) Yes I understand that. (and it would be just as easy to map pixels to 0-1)

I might be misunderstanding you, but when I design a GUI, I think in terms of "this view should be 120 pixels from the left" and not "this view should be 0.2393 * viewWidth
from the left".

I think it's natural to think about views and drawing in terms of pixels.

Interesting if there are differences in background here. I'm not an engineer so I tend to think in "real" numbers. An engineer perhaps likes to think about everything
in terms of 0-1. ??? : )

Not that I'm labeling you an engineer Jan!!!

Is beeing an engineer bad? (the german guy asks :-)

IMHO thinking in [0..1] or real pixel coordinates depends on the situation: absolute pixels are nice for exact (engineered :-) positioning, whereas 0-1 mapping is a reasonable feature for relative positioning. In my experience gui development is always a hassle when it comes to positioning views and handling coordinates, so either way you turn it you always have to calculate something on your own. So.... IMHO you should just return it in pixels, justified by KISS... :-)

2c
Till