[Libreoffice] Rectangle width

Thorsten Behrens thb at documentfoundation.org
Wed Aug 17 14:08:58 PDT 2011


Dmitry. A. Ashkadov wrote:
> I found out that class Rectangle contains two different finctions
> getWidth() and GetWidth(). The first returns wrong value.
> 
Hi Dmitry - yes, the two different methods are surely confusing. As
for the "wrong value", that very much depends on the mental model of
rectangles you're using. In a discrete geometry world (aka "pixel"),
the GetWidth() is correct. In a continuous geometry world (aka
"euclidean plane"), getWidth() is right.

This fundamental, conceptual difference is the historical reason for
the two methods (admittedly, not a very clean solution to the
problem).

Cheers,

-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110817/e94d18c8/attachment.pgp>


More information about the LibreOffice mailing list