RFC: Sane rectangle class

Noel Grandin noelgrandin at gmail.com
Thu Mar 19 17:01:41 UTC 2020

On Thu, 19 Mar 2020 at 17:14, Luboš Luňák <l.lunak at collabora.com> wrote:

> - internal representation will be whatever sane thing will work, e.g.
> x,y,width,height , and it won't matter for the API
> - empty rectangle is simply width == 0 || height == 0
+1 on this part.

FWIW, the Java Rectangle API is pretty much this.

One important thing - we will need to choose a fundamental type i.e
float32/float64/int32/int64 for the co-ords.

All of these have the normal pro's and con's when it comes to graphics APIs.

With one extra wrinkle: the current tools::Rectangle uses long, and lots of
places that work with tools::Rectangle also use long, which is particularly
pernicious because long is a different bit-size on Windows and Linux.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20200319/9d094dcb/attachment.htm>

More information about the LibreOffice mailing list