summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2012-06-17 15:41:46 +0200
committerTomaž Vajngerl <quikee@gmail.com>2012-06-17 15:49:00 +0200
commitdc068d34271d070267e61f4761aebf8ccaabf299 (patch)
tree665dcab0fdd5b904bda9eb9eca5d07b39d554734 /cui
parent0db1b46a45694a735d0f33f5c5a1facede58e653 (diff)
Filter dialog preview image size was wrongly calculated in some cases.
Change-Id: I22fdf17e6f2112624963da6293efddfa75507dd7
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx27
-rw-r--r--cui/source/inc/cuigrfflt.hxx2
2 files changed, 18 insertions, 11 deletions
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index f074e1779f66..0b846cbdea32 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -59,15 +59,22 @@ void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
{
Control::Paint( rRect );
- const Size aGrfSize( LogicToPixel( maGraphic.GetPrefSize(), maGraphic.GetPrefMapMode() ) );
- const Size aOutSize( GetOutputSizePixel() );
- const Point aGrfPos( ( aOutSize.Width() - aGrfSize.Width() ) >> 1,
- ( aOutSize.Height() - aGrfSize.Height() ) >> 1 );
+ const Size aOutputSize( GetOutputSizePixel() );
if( maGraphic.IsAnimated() )
- maGraphic.StartAnimation( this , aGrfPos, aGrfSize );
+ {
+ const Size aGraphicSize( LogicToPixel( maGraphic.GetPrefSize(), maGraphic.GetPrefMapMode() ) );
+ const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
+ ( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 );
+ maGraphic.StartAnimation( this, aGraphicPosition, aGraphicSize );
+ }
else
- maGraphic.Draw( this, aGrfPos, aGrfSize );
+ {
+ const Size aGraphicSize( maGraphic.GetSizePixel() );
+ const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
+ ( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 );
+ maGraphic.Draw( this, aGraphicPosition, aGraphicSize );
+ }
}
// -----------------------------------------------------------------------------
@@ -110,13 +117,13 @@ GraphicFilterDialog::GraphicFilterDialog( Window* pParent, const ResId& rResId,
if( fGrfWH < fPreWH )
{
- aGrfSize.Width() = (long) ( aPreviewSize.Height() * fGrfWH );
- aGrfSize.Height()= aPreviewSize.Height();
+ aGrfSize.Width() = (long) ( aPreviewSize.Height() * fGrfWH );
+ aGrfSize.Height() = aPreviewSize.Height();
}
else
{
- aGrfSize.Width() = aPreviewSize.Width();
- aGrfSize.Height()= (long) ( aPreviewSize.Width() / fGrfWH);
+ aGrfSize.Width() = aPreviewSize.Width();
+ aGrfSize.Height() = (long) ( aPreviewSize.Width() / fGrfWH );
}
mfScaleX = (double) aGrfSize.Width() / maSizePixel.Width();
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index 98303e058baf..f9cb62419647 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -53,7 +53,7 @@ private:
{
private:
- GraphicObject maGraphic;
+ Graphic maGraphic;
virtual void Paint( const Rectangle& rRect );