Add AdjustX method to basegfx::B2DPoint

Alexander Farrow alexanderfarrow at
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" <>

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

basegfx::B2DPoint <> 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 <> 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: <>

More information about the LibreOffice mailing list