On Thursday 19 of March 2020, Noel Grandin wrote:
On Thu, 19 Mar 2020 at 17:14, Luboš Luňák <l.lunak@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.
UNO Rectangle is like that too, I missed that one.
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.
My intention here is fill in the role that tools::Rectangle currently fills,
so the obvious choice seems to be to use integers just as that one does.
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.
Do you know a specific case where that actually matters? My personal position
on integers is "use int, unless you explicitly need something else".
--
Luboš Luňák
l.lunak@collabora.com
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.