[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Coordinates in KSpread (and maybe other KOffice components).
From:       David Faure <dfaure () klaralvdalens-datakonsult ! se>
Date:       2005-03-17 14:44:39
Message-ID: 200503171544.40324.dfaure () klaralvdalens-datakonsult ! se
[Download RAW message or body]

On Thursday 17 March 2005 14:18, Inge Wallin wrote:
> Hi gang,
> 
> I have started to take on the printing bugs of KSpread, but I am a bit 
> confused. 
> 
> I can see the use for at least 3 different coordinate systems within KSPread:
> 1. Cell coordinates (A1 would be (0, 0))
> 2. Screen coordinates in pixels
> 3. Metric coordinates which designates an absolute origin of a cell with the 
> width and height given in centimeters, millimeters or whatever.
> 
> I am sure that all these coordinate systems are used inside KSpread, but I 
> haven't found any documentation about which members are using which system.  
> In some instances it is obvious, but far from all.
> 
> Especially in a lot of calls to methods of, for instance, KSpreadCell, there 
> are a lot of QPoints, KoPoints, QRects and KoRects being passed but they are 
> never explained.

I'm not 100% sure about what KSpread does, but in other KOffice apps at least,
KoPoint and KoRect (which are floating point) are for expressing coordinates
in pt (use KoUnit for converting that to other units like cm, mm, inch etc.).

See koffice/lib/kotext/DESIGN for how KoZoomHandler allows to go from pt to pixels
and back - but most of this does NOT apply to kspread since it doesn't use kotext
(so, skip everything about kotext's "internal coordinate system").
KSpread uses KoZoomHandler though, for pt<->pixels at a given zoom level.

-- 
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic