Add AdjustX method to basegfx::B2DPoint

Thorsten Behrens thb at libreoffice.org
Fri Apr 5 23:30:26 UTC 2019


Hi Alex,

Alexander Farrow wrote:
> basegfx::B2DPoint
> <https://docs.libreoffice.org/basegfx/html/classbasegfx_1_1B2DPoint.html>
> does not have such a method. So calls to AdjustX(nHorzMove) are
> being replaced by something like setX(getX() + nHorzMove).
>
tools::Point is not exactly a role model for a nicely designed class,
so I'd hesitate to take any literal bits out of that. ;)

Many places using AdjustX() also call AdjustY() just the next line, so
for that you could use basegfx::B2DPoint::operator+=(const B2DTuple&)

If you believe you *must* use a single-component modifier, please come
up with something that blends well with the b2dtuple/point
concept. Also ideally, you will maintain some amount of internal
consistency (e.g. compare how operator*, *= etc. all got added in
farious flavours, such that math with b2dtuples works like the
'canonical' way when done with skalars or various forms of vectors).

Cheers,

-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1032 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20190406/788e0557/attachment.sig>


More information about the LibreOffice mailing list