Hi Andrea,

Yes, it would probably be more intuitive for most users to have aspect
ratio correction as the default behaviour. On the other hand, Ian's
query is the first one I can remember had about it, so it doesn't seem
worth making work for your and/or GeoServer users.

I don't really like the setMatchingAspectRatio method. A constructor
flag would be a bit nicer and probably less error-prone, but I didn't
go that way because I thought users would be working with a
MapViewport instance created for them by the MapContent more often
than they would create viewports directly.  A hint might be ok, but I
think hints are easier for new users to overlook.  Perhaps the present
API is the least worst option :)

More importantly, I'm now worried that the calculation of transforms
in the viewport for uncorrected aspect-ratio is wrong. I just read
Ian's question again properly (ie. brain turned on) and he was getting
a negative device coordinate which can't be right. Looking at
MapViewport.calculateSimpleTransforms method I see that I'm using a
common scale for X and Y directions. No idea why I did that - surely
it should be independent for each axis.  But then, if it's broken as
it seems to be, how are the GeoServer unit tests passing ?

Michael


On 22 April 2012 01:49, Andrea Aime <[email protected]> wrote:
>
> Michael, I'm wondering, are the GUI components default to enforcing
> the natural aspect ratio?
>
> I also considered just switching the default the other way, for GeoServer
> it would be like 5-10 lines of code sprinkled around to get the desired
> behavior back... but it would also be a backwards incompatible change
> that might throw off other existing users besides just GeoServer.
>
> Another random idea might be to have the defaul be driven by a system
> Hint, so that the default can be flipped for the whole application with
> a single line of code
>
> Anyways... just ranting
>
> Cheers
> Andrea
>

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to