Re: RFC: Sane rectangle class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread 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

_______________________________________________
LibreOffice mailing list
LibreOffice@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/libreoffice

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux