LibreOffice Module svx (master) 1
Functions
modctrl_internal.hxx File Reference
#include <tools/gen.hxx>
Include dependency graph for modctrl_internal.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Point centerImage (const tools::Rectangle &rBoundingRect, const Image &rImg)
 Given a bounding rectangle and an image, determine the top-left position of the image so that the image would look centered both horizontally and vertically. More...
 

Function Documentation

◆ centerImage()

Point centerImage ( const tools::Rectangle rBoundingRect,
const Image rImg 
)

Given a bounding rectangle and an image, determine the top-left position of the image so that the image would look centered both horizontally and vertically.

Parameters
rBoundingRectbounding rectangle
rImgimage
Returns
Point top-left corner of the centered image position

Definition at line 127 of file modctrl.cxx.

References Size::getHeight(), tools::Rectangle::GetSize(), Image::GetSizePixel(), Size::getWidth(), and tools::Rectangle::TopLeft().

Referenced by SvxZoomPageStatusBarControl::Paint(), and SvxModifyControl::Paint().