Date: prev next · Thread: first prev next last
2020 Archives by date, by thread · List index


Hi Regina, *,

Regina Henschel wrote:
These off-by-one problems occur earlier than in VCL. For example
changes to maSnapRect when a shape is transformed by shear and
rotation.

Yep. Also c.f. SwRect mentioned earlier.

A new kind of rectangle does not solve the problem, that you have to
examine each use, whether including or excluding the edge is
better. I think, only switching to double and using it a long as
possible would really help to reduce off-by-one problems and
increase accuracy.

There's still the half-open vs. closed interval difference, that is
orthogonal to the underlying value type.

Half-open is the natural definition for everything that gets
'rendered', as it matches semantics of polygon/triangle fill
algorithms.

Closed intervals seems to be more 'natural' as a concept - you stick
two points into that interval, and both will yield 'true' when you ask
the range then whether those two points are inside..

You can map either of those to both floating point and integer value
types; for basegfx currently, interestingly B2DRange (which uses
doubles) uses closed interval semantics.

Cheers,

-- Thorsten

Attachment: signature.asc
Description: PGP signature


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.