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 ...@@ -57,27 +57,25 @@ void GraphicPreviewWindow::Paint(vcl::RenderContext& rRenderContext, const Recta
{ {
Control::Paint(rRenderContext, rRect); 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 Size aGraphicSize(rRenderContext.LogicToPixel(maPreview.GetPrefSize(), maPreview.GetPrefMapMode()));
const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1, const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 ); (aOutputSize.Height() - aGraphicSize.Height() ) >> 1);
maPreview.StartAnimation( this, aGraphicPosition, aGraphicSize ); maPreview.StartAnimation(&rRenderContext, aGraphicPosition, aGraphicSize);
} }
else else
{ {
const Size aGraphicSize( maPreview.GetSizePixel() ); const Size aGraphicSize(maPreview.GetSizePixel());
const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1, const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width()) >> 1,
( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 ); (aOutputSize.Height() - aGraphicSize.Height()) >> 1);
maPreview.Draw( this, aGraphicPosition, aGraphicSize ); maPreview.Draw(&rRenderContext, aGraphicPosition, aGraphicSize);
} }
} }
void GraphicPreviewWindow::SetPreview(const Graphic& rGraphic)
void GraphicPreviewWindow::SetPreview( const Graphic& rGraphic )
{ {
maPreview = rGraphic; maPreview = rGraphic;
Invalidate(); 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