path: root/editeng
diff options
authorTomaž Vajngerl <>2019-06-28 00:03:19 +0900
committerTomaž Vajngerl <>2019-07-01 04:49:07 +0200
commitbfc19d77cb8db445f1c6123347c19a4c0c6a6cf8 (patch)
treed5deaaa44975838dec487d977d064c37080cf40e /editeng
parent45a2eecfee472d8822130a90999b46ad371dee95 (diff)
Improve the looks of a wave line by draw it with bezier curves
This adds drawing the wave line (typically used to underline the wrongly spelled words) with bezier curves. Previously the wave lines were drawn with drawing pixels, which didn't look that good, especially on HiDPI display, so the looks of wave lines now is therefor much better. The creation of the wave line as a polygon has been added to the basegfx module, so it can be reused if needed. In addition, everytime we draw the waveline, we have to enable antialiasing, to have a much better quality of the curves. By default the antialiasing is disabled for some reason. This also adds ScopedStates.hxx file which currently includes ScopedAntialiasing, which sets the antialiasing to a certain state for the time the object is in scope, and then sets it back to the original state. Change-Id: I4b866fc5d69725eb7f6f78a1acf4176b1205aa73 Reviewed-on: Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <>
Diffstat (limited to 'editeng')
1 files changed, 6 insertions, 1 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 1e0b4e51feb5..976a94ea2f1a 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -77,6 +77,8 @@
#include <comphelper/lok.hxx>
#include <memory>
+#include <vcl/outdev/ScopedStates.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -223,7 +225,10 @@ static void lcl_DrawRedLines( OutputDevice* pOutDev,
aPoint2 = Rotate(aPoint2, nOrientation, rOrigin);
- pOutDev->DrawWaveLine(aPoint1, aPoint2);
+ {
+ vcl::ScopedAntialiasing a(*pOutDev, true);
+ pOutDev->DrawWaveLine(aPoint1, aPoint2);
+ }
nStart = nEnd + 1;
if (nEnd < nMaxEnd)