Kaydet (Commit) 848e020f authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

move Resize code to Paint for ScTextWnd

Change-Id: Icd0e12e02b808c3cf1eacd15021cdf249bdcfab3
üst 71131e2b
...@@ -1518,6 +1518,10 @@ void ScTextWnd::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect ...@@ -1518,6 +1518,10 @@ void ScTextWnd::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect
{ {
if (pEditView) if (pEditView)
{ {
Size aSize = rRenderContext.GetOutputSizePixel();
long nDiff = aSize.Height() - rRenderContext.LogicToPixel(Size(0, rRenderContext.GetTextHeight())).Height();
pEditView->SetOutputArea(rRenderContext.PixelToLogic(Rectangle(Point(0, (nDiff > 0) ? nDiff / 2 : 1), aSize)));
pEditView->Paint(rRect, &rRenderContext); pEditView->Paint(rRect, &rRenderContext);
} }
else else
...@@ -1544,14 +1548,7 @@ void ScTextWnd::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect ...@@ -1544,14 +1548,7 @@ void ScTextWnd::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect
void ScTextWnd::Resize() void ScTextWnd::Resize()
{ {
if (pEditView) Invalidate();
{
Size aSize = GetOutputSizePixel();
long nDiff = aSize.Height() - LogicToPixel( Size( 0, GetTextHeight() ) ).Height();
pEditView->SetOutputArea(PixelToLogic( Rectangle( Point( 0, (nDiff > 0) ? nDiff/2 : 1 ),
aSize ) ) );
}
} }
void ScTextWnd::MouseMove( const MouseEvent& rMEvt ) void ScTextWnd::MouseMove( const MouseEvent& rMEvt )
......
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