Bugzilla – Attachment 71331 Details for
Bug 42553
VIEWING: wrong rectangular gradient geometry in SLIDESHOW
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix square gradient rendering
0001-fdo-42553-fix-square-gradient-rendering-by-vcl.patch (text/plain), 3.04 KB, created by
Michael Meeks
on 2012-12-11 11:28:40 UTC
(
hide
)
Description:
fix square gradient rendering
Filename:
MIME Type:
Creator:
Michael Meeks
Created:
2012-12-11 11:28:40 UTC
Size:
3.04 KB
patch
obsolete
>From 1daefb26d37e255c98c0c5fe773669c39806dd10 Mon Sep 17 00:00:00 2001 >From: Michael Meeks <michael.meeks@suse.com> >Date: Tue, 11 Dec 2012 11:28:30 +0000 >Subject: [PATCH] fdo#42553 - fix square gradient rendering by vcl. > >--- > vcl/source/gdi/gradient.cxx | 7 ------- > vcl/source/gdi/outdev4.cxx | 21 ++++++++++++++++----- > 2 files changed, 16 insertions(+), 12 deletions(-) > >diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx >index 5a776e3..06b3e48 100644 >--- a/vcl/source/gdi/gradient.cxx >+++ b/vcl/source/gdi/gradient.cxx >@@ -286,13 +286,6 @@ void Gradient::GetBoundRect( const Rectangle& rRect, Rectangle& rBoundRect, Poin > aSize.Width() = (long)( 0.5 + (double) aSize.Width() * 1.4142 ); > aSize.Height() = (long)( 0.5 + (double) aSize.Height() * 1.4142 ); > } >- else if( GetStyle() == GradientStyle_SQUARE ) >- { >- if ( aSize.Width() > aSize.Height() ) >- aSize.Height() = aSize.Width(); >- else >- aSize.Width() = aSize.Height(); >- } > > // neue Mittelpunkte berechnen > long nZWidth = aRect.GetWidth() * (long) GetOfsX() / 100; >diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx >index 8096924..4e895eb 100644 >--- a/vcl/source/gdi/outdev4.cxx >+++ b/vcl/source/gdi/outdev4.cxx >@@ -481,7 +481,18 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect, > double fScanTop = aRect.Top(); > double fScanRight = aRect.Right(); > double fScanBottom = aRect.Bottom(); >- double fScanInc = (double) nMinRect / (double) nSteps * 0.5; >+ double fScanIncX = (double) aRect.GetWidth() / (double) nSteps * 0.5; >+ double fScanIncY = (double) aRect.GetHeight() / (double) nSteps * 0.5; >+ >+ // all gradients are rendered as nested rectangles which shrink >+ // equally in each dimension - except for 'square' gradients >+ // which shrink to a central vertex but are not per-se square. >+ if( rGradient.GetStyle() != GradientStyle_SQUARE ) >+ { >+ fScanIncY = std::min( fScanIncY, fScanIncX ); >+ fScanIncX = fScanIncY; >+ } >+ > sal_uInt8 nRed = (sal_uInt8) nStartRed, nGreen = (sal_uInt8) nStartGreen, nBlue = (sal_uInt8) nStartBlue; > bool bPaintLastPolygon( false ); // #107349# Paint last polygon only if loop has generated any output > >@@ -512,10 +523,10 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect, > for( long i = 1; i < nSteps; i++ ) > { > // neues Polygon berechnen >- aRect.Left() = (long)( fScanLeft += fScanInc ); >- aRect.Top() = (long)( fScanTop += fScanInc ); >- aRect.Right() = (long)( fScanRight -= fScanInc ); >- aRect.Bottom() = (long)( fScanBottom -= fScanInc ); >+ aRect.Left() = (long)( fScanLeft += fScanIncX ); >+ aRect.Top() = (long)( fScanTop += fScanIncY ); >+ aRect.Right() = (long)( fScanRight -= fScanIncX ); >+ aRect.Bottom() = (long)( fScanBottom -= fScanIncY ); > > if( ( aRect.GetWidth() < 2 ) || ( aRect.GetHeight() < 2 ) ) > break; >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 42553
:
53110
|
53111
|
53474
|
61021
| 71331