LibreOffice Module chart2 (master) 1
Static Public Member Functions | List of all members
chart::RelativePositionHelper Class Reference

#include <RelativePositionHelper.hxx>

Static Public Member Functions

static css::awt::Point getUpperLeftCornerOfAnchoredObject (css::awt::Point aPoint, css::awt::Size aObjectSize, css::drawing::Alignment aAnchor)
 returns the upper left corner of an object that has size aObjectSize and where the point indicated by aAnchor has coordinates indicated by aPoint ( e.g. More...
 
static css::awt::Point getCenterOfAnchoredObject (css::awt::Point aPoint, css::awt::Size aUnrotatedObjectSize, css::drawing::Alignment aAnchor, double fAnglePi)
 returns the center of an object that has size aObjectSize and where the point indicated by aAnchor has coordinates indicated by aPoint ( e.g. More...
 
static SAL_DLLPRIVATE css::chart2::RelativePosition getReanchoredPosition (const css::chart2::RelativePosition &rPosition, const css::chart2::RelativeSize &rObjectSize, css::drawing::Alignment aNewAnchor)
 Returns a relative position that is the same point after the anchor has been changed to the given one. More...
 
static bool centerGrow (css::chart2::RelativePosition &rInOutPosition, css::chart2::RelativeSize &rInOutSize, double fAmountX, double fAmountY)
 grows a relative size about the given amount and shifts the given position such that the resize is relative to the former rectangle's center. More...
 
static bool moveObject (css::chart2::RelativePosition &rInOutPosition, const css::chart2::RelativeSize &rObjectSize, double fAmountX, double fAmountY)
 shifts a relative position about the given amount More...
 

Detailed Description

Definition at line 33 of file RelativePositionHelper.hxx.

Member Function Documentation

◆ centerGrow()

bool chart::RelativePositionHelper::centerGrow ( css::chart2::RelativePosition &  rInOutPosition,
css::chart2::RelativeSize &  rInOutSize,
double  fAmountX,
double  fAmountY 
)
static

grows a relative size about the given amount and shifts the given position such that the resize is relative to the former rectangle's center.

The resize is only done, if after transformation, the position and size are within the bounds [0,1].

Returns
</sal_True>, if changes were applied.

That means, if the position's alignment is center, the position will not change at all.

Definition at line 247 of file RelativePositionHelper.cxx.

References getReanchoredPosition().

◆ getCenterOfAnchoredObject()

awt::Point chart::RelativePositionHelper::getCenterOfAnchoredObject ( css::awt::Point  aPoint,
css::awt::Size  aUnrotatedObjectSize,
css::drawing::Alignment  aAnchor,
double  fAnglePi 
)
static

returns the center of an object that has size aObjectSize and where the point indicated by aAnchor has coordinates indicated by aPoint ( e.g.

if aAnchor equals BOTTOM_LEFT, aPoint describes the coordinates of the bottom left corner of an object with size aObjectSize )

Definition at line 183 of file RelativePositionHelper.cxx.

◆ getReanchoredPosition()

chart2::RelativePosition chart::RelativePositionHelper::getReanchoredPosition ( const css::chart2::RelativePosition &  rPosition,
const css::chart2::RelativeSize &  rObjectSize,
css::drawing::Alignment  aNewAnchor 
)
static

Returns a relative position that is the same point after the anchor has been changed to the given one.

The passed object size is taken into account for shifting the position.

Definition at line 31 of file RelativePositionHelper.cxx.

Referenced by centerGrow(), and moveObject().

◆ getUpperLeftCornerOfAnchoredObject()

awt::Point chart::RelativePositionHelper::getUpperLeftCornerOfAnchoredObject ( css::awt::Point  aPoint,
css::awt::Size  aObjectSize,
css::drawing::Alignment  aAnchor 
)
static

returns the upper left corner of an object that has size aObjectSize and where the point indicated by aAnchor has coordinates indicated by aPoint ( e.g.

if aAnchor equals BOTTOM_LEFT, aPoint describes the coordinates of the bottom left corner of an object with size aObjectSize )

Definition at line 125 of file RelativePositionHelper.cxx.

Referenced by chart::VSeriesPlotter::createRegressionCurveEquationShapes(), and chart::DiagramHelper::getDiagramRectangleFromModel().

◆ moveObject()

bool chart::RelativePositionHelper::moveObject ( css::chart2::RelativePosition &  rInOutPosition,
const css::chart2::RelativeSize &  rObjectSize,
double  fAmountX,
double  fAmountY 
)
static

shifts a relative position about the given amount

The shift is only done, if after transformation, the object represented by the position rInOutPosition and its size rObjectSize the position and size are within the bounds [0,1].

Returns
</sal_True>, if changes were applied.

Definition at line 352 of file RelativePositionHelper.cxx.

References getReanchoredPosition().


The documentation for this class was generated from the following files: