<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 29, 2022 at 9:06 AM Chris Sherlock <<a href="mailto:chris.sherlock79@gmail.com">chris.sherlock79@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 27, 2022 at 4:52 PM Miklos Vajna <<a href="mailto:vmiklos@collabora.com" target="_blank">vmiklos@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Chris,<br>
<br>
On Mon, Jun 13, 2022 at 01:03:30PM +1000, Chris Sherlock <<a href="mailto:chris.sherlock79@gmail.com" target="_blank">chris.sherlock79@gmail.com</a>> wrote:<br>
> LibreOffice has seperate implementations for points, lines, rectangle, polygons and polypolygons - one is in the tools module, and the other is in the basegfx module.<br>
> <br>
> Are there any plans for deprecating the usage of the tools geometry primitives? I understand it will be needed for deserialising some legacy svm files, but is the intention to ever start replacing the tools primitives with the basegfx primitives?<br>
<br>
The trouble with e.g. tools::Rectangle is that it can have both a closed<br>
or a half-open interval, and you need to read the surrounding code to<br>
understand which mode is in use. basegfx::B2IRange is explicitly closed.<br>
<br>
So it would help readability to go with basegfx::B2IRange everywhere,<br>
but it's not an easy hack to do such conversions.<br>
<br>
Regards,<br>
<br>
Miklos<br></blockquote><div><br></div><div><div>Thanks Miklos. I read the comment above the Rectangle header 
definition which starts with "Note: this class is a true marvel of 
engineering: because the author could not decide whether it's better to 
have a closed or half-open interval, they just implemented *both* in the
 same class!"</div><div><br></div><div>What is the feasibility of changing this class to be only explicitly closed? </div><div><br></div><div>Is this the main issue with not converting over to basegfx?</div><font color="#888888"><div><br></div><div>Chris</div></font></div></div></div></blockquote><div><br></div><div>A quick followup - I have changed the getWidth() and getHeight() functions in tools::Rectangle to getHalfOpenWidth/getHalfOpenHeight() - it seems needlessly confusing to have functions with the same name except capitalizing the first letter (!!) and have differing functionality.</div><div><br></div><div>The gerrit commit is here:</div><div><br></div><div><a href="https://gerrit.libreoffice.org/c/core/+/136575">https://gerrit.libreoffice.org/c/core/+/136575</a></div><div><br> </div><div>Is this reasonable?</div><div><br></div><div>Chris<br></div></div></div>