diff options
author | Dr. David Alan Gilbert <dave@treblig.org> | 2023-07-13 14:52:07 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-16 12:55:19 +0200 |
commit | 80b4e90e055825e3fef6fa11796bf4f40627c478 (patch) | |
tree | 5f7d4e5beadf3e2f9387bf7392861a953f3e05e2 /editeng/source | |
parent | 38372f103aa5035ec32570972e55656e07647791 (diff) |
editeng/Outliner: Use RotateAround rather than open coding
In PaintBullet, use Tools::Point's RotateAround instead of open coding.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Change-Id: I4f5a50a70d8fcadd2e5af60e365de80f2e9a271e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154393
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 04f55eb7dbdb..5af4573bf659 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -945,18 +945,8 @@ void Outliner::PaintBullet(sal_Int32 nPara, const Point& rStartPos, const Point& { // Both TopLeft and bottom left is not quite correct, // since in EditEngine baseline ... - double nRealOrientation = toRadians(nOrientation); - double nCos = cos( nRealOrientation ); - double nSin = sin( nRealOrientation ); - Point aRotatedPos; - // Translation... - aTextPos -= rOrigin; - // Rotation... - aRotatedPos.setX(static_cast<tools::Long>(nCos*aTextPos.X() + nSin*aTextPos.Y()) ); - aRotatedPos.setY(static_cast<tools::Long>(- (nSin*aTextPos.X() - nCos*aTextPos.Y())) ); - aTextPos = aRotatedPos; - // Translation... - aTextPos += rOrigin; + rOrigin.RotateAround(aTextPos, nOrientation); + vcl::Font aRotatedFont( aBulletFont ); aRotatedFont.SetOrientation( nOrientation ); rOutDev.SetFont( aRotatedFont ); |