From 2f844056c340ead941188fd1ea7ad2b1400586aa Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sun, 3 May 2020 11:32:25 +0200 Subject: drawinglayer: flatten renderWrongSpellPrimitive2D MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I93ff19f9f54b6f14c660af554d697b9ba525f81c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93389 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- .../processor2d/helperwrongspellrenderer.cxx | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/processor2d/helperwrongspellrenderer.cxx b/drawinglayer/source/processor2d/helperwrongspellrenderer.cxx index 83fdba7cc1f5..27df21201efe 100644 --- a/drawinglayer/source/processor2d/helperwrongspellrenderer.cxx +++ b/drawinglayer/source/processor2d/helperwrongspellrenderer.cxx @@ -40,30 +40,30 @@ bool renderWrongSpellPrimitive2D(const primitive2d::WrongSpellPrimitive2D& rWron static const sal_uInt32 nMinimumFontHeight(5); // #define WRONG_SHOW_MIN 5 - if (nFontPixelHeight > nMinimumFontHeight) - { - const basegfx::B2DPoint aStart(aLocalTransform - * basegfx::B2DPoint(rWrongSpellCandidate.getStart(), 0.0)); - const basegfx::B2DPoint aStop(aLocalTransform - * basegfx::B2DPoint(rWrongSpellCandidate.getStop(), 0.0)); - const Point aVclStart(basegfx::fround(aStart.getX()), basegfx::fround(aStart.getY())); - const Point aVclStop(basegfx::fround(aStop.getX()), basegfx::fround(aStop.getY())); + if (nFontPixelHeight <= nMinimumFontHeight) + return true; - // #i101075# draw it. Do not forget to use the evtl. offsetted origin of the target device, - // e.g. when used with mask/transparence buffer device - const Point aOrigin(rOutputDevice.GetMapMode().GetOrigin()); + const basegfx::B2DPoint aStart(aLocalTransform + * basegfx::B2DPoint(rWrongSpellCandidate.getStart(), 0.0)); + const basegfx::B2DPoint aStop(aLocalTransform + * basegfx::B2DPoint(rWrongSpellCandidate.getStop(), 0.0)); + const Point aVclStart(basegfx::fround(aStart.getX()), basegfx::fround(aStart.getY())); + const Point aVclStop(basegfx::fround(aStop.getX()), basegfx::fround(aStop.getY())); - const basegfx::BColor aProcessedColor( - rBColorModifierStack.getModifiedColor(rWrongSpellCandidate.getColor())); - const bool bMapModeEnabledState(rOutputDevice.IsMapModeEnabled()); + // #i101075# draw it. Do not forget to use the evtl. offsetted origin of the target device, + // e.g. when used with mask/transparence buffer device + const Point aOrigin(rOutputDevice.GetMapMode().GetOrigin()); - vcl::ScopedAntialiasing a(rOutputDevice, true); - rOutputDevice.EnableMapMode(false); - rOutputDevice.SetLineColor(Color(aProcessedColor)); - rOutputDevice.SetFillColor(); - rOutputDevice.DrawWaveLine(aOrigin + aVclStart, aOrigin + aVclStop); - rOutputDevice.EnableMapMode(bMapModeEnabledState); - } + const basegfx::BColor aProcessedColor( + rBColorModifierStack.getModifiedColor(rWrongSpellCandidate.getColor())); + const bool bMapModeEnabledState(rOutputDevice.IsMapModeEnabled()); + + vcl::ScopedAntialiasing a(rOutputDevice, true); + rOutputDevice.EnableMapMode(false); + rOutputDevice.SetLineColor(Color(aProcessedColor)); + rOutputDevice.SetFillColor(); + rOutputDevice.DrawWaveLine(aOrigin + aVclStart, aOrigin + aVclStop); + rOutputDevice.EnableMapMode(bMapModeEnabledState); // cannot really go wrong return true; -- cgit