summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-03-06 18:40:36 +0100
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-03-12 13:03:03 -0500
commitab2739b37d8c331aa5ed26346c7e29199a369571 (patch)
treee997c7dc480b30a1839bc81f4e3eb9799175c96b
parent8f805c57aadab54de421b0f961d0cbda9fa6d386 (diff)
hidpi: Nicer painting of the waved lines.
Change-Id: I8773b47967bc1aa8cf33b9a1edc4f826291d3554 Reviewed-on: https://gerrit.libreoffice.org/8518 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--vcl/source/gdi/outdev3.cxx29
1 files changed, 22 insertions, 7 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index afe06f706b52..d97b71be079e 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -419,6 +419,7 @@ static void ImplFontSubstitute( OUString& rFontName,
}
}
+//hidpi TODO: This routine has hard-coded font-sizes that break places such as DialControl
Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
sal_uLong nFlags, const OutputDevice* pOutDev )
{
@@ -5339,11 +5340,24 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
}
long nWaveHeight;
+
if ( nStyle == WAVE_NORMAL )
{
nWaveHeight = 3;
nStartY++;
nEndY++;
+
+ if (mnDPIScaleFactor > 1)
+ {
+ nWaveHeight *= mnDPIScaleFactor;
+
+ // odd heights look better than even
+ if (mnDPIScaleFactor % 2 == 0)
+ {
+ nStartY++; // Shift down an additional pixel to create more visual separation.
+ nWaveHeight--;
+ }
+ }
}
else if( nStyle == WAVE_SMALL )
{
@@ -5354,14 +5368,15 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
else // WAVE_FLAT
nWaveHeight = 1;
- // #109280# make sure the waveline does not exceed the descent to avoid paint problems
- ImplFontEntry* pFontEntry = mpFontEntry;
- if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize )
- nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
+ // #109280# make sure the waveline does not exceed the descent to avoid paint problems
+ ImplFontEntry* pFontEntry = mpFontEntry;
+ if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize )
+ nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
+
+ ImplDrawWaveLine(nStartX, nStartY, 0, 0,
+ nEndX-nStartX, nWaveHeight,
+ mnDPIScaleFactor, nOrientation, GetLineColor());
- ImplDrawWaveLine( nStartX, nStartY, 0, 0,
- nEndX-nStartX, nWaveHeight, 1,
- nOrientation, GetLineColor() );
if( mpAlphaVDev )
mpAlphaVDev->DrawWaveLine( rStartPos, rEndPos, nStyle );
}