Kaydet (Commit) 65856fe5 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

refactor GraphicPreviewWindow to use RenderContext

Change-Id: I3471ca2c51782f6537d2bbc2fabc791c5f63d66c
üst 0b08ae6d
......@@ -57,27 +57,25 @@ void GraphicPreviewWindow::Paint(vcl::RenderContext& rRenderContext, const Recta
{
Control::Paint(rRenderContext, rRect);
const Size aOutputSize( GetOutputSizePixel() );
const Size aOutputSize(rRenderContext.GetOutputSizePixel());
if( maPreview.IsAnimated() )
if (maPreview.IsAnimated())
{
const Size aGraphicSize( LogicToPixel( maPreview.GetPrefSize(), maPreview.GetPrefMapMode() ) );
const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 );
maPreview.StartAnimation( this, aGraphicPosition, aGraphicSize );
const Size aGraphicSize(rRenderContext.LogicToPixel(maPreview.GetPrefSize(), maPreview.GetPrefMapMode()));
const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
(aOutputSize.Height() - aGraphicSize.Height() ) >> 1);
maPreview.StartAnimation(&rRenderContext, aGraphicPosition, aGraphicSize);
}
else
{
const Size aGraphicSize( maPreview.GetSizePixel() );
const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 );
maPreview.Draw( this, aGraphicPosition, aGraphicSize );
const Size aGraphicSize(maPreview.GetSizePixel());
const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width()) >> 1,
(aOutputSize.Height() - aGraphicSize.Height()) >> 1);
maPreview.Draw(&rRenderContext, aGraphicPosition, aGraphicSize);
}
}
void GraphicPreviewWindow::SetPreview( const Graphic& rGraphic )
void GraphicPreviewWindow::SetPreview(const Graphic& rGraphic)
{
maPreview = rGraphic;
Invalidate();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment