Add AdjustX method to basegfx::B2DPoint

Alexander Farrow alexanderfarrow at tutanota.com
Fri Apr 5 18:42:24 UTC 2019


Hi everybody,

Recently for GSoC I have been looking into resolving
"Use floating point for glyph positioning in VCL" <https://bugs.documentfoundation.org/show_bug.cgi?id=103322>

This involves changing the types of variables from tools::Point to basegfx::B2DPoint.
tools::Point <https://docs.libreoffice.org/tools/html/classPoint.html> has a method called AdjustX(long nHorzMove), which adds nHorzMove to X:

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).

It works fine of course but I think AdjustX looks cleaner and it feels like a step
backwards when moving from tools::Point to basegfx::B2DPoint.

An OpenGrok search <https://opengrok.libreoffice.org/search?project=core&refs=AdjustX> for AdjustX reveals it is used frequently in the code-base,
which suggests it is a method which developers have found useful in the past.

If it is agreed that we should add such a method I would be happy to implement it.
Also for consistency we might want to add a similar method to other classes in
basegfx such as B2IPoint.

With many thanks,
Alexander Farrow (IRC: Alexander Farrow)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20190405/b6e4727c/attachment.html>


More information about the LibreOffice mailing list