Minor simplification in generic wxCaret
Only create wxMemoryDC if it's actually needed.
This commit is contained in:
@@ -243,13 +243,10 @@ void wxCaret::Refresh()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryDC dcMem;
|
|
||||||
dcMem.SelectObject(m_bmpUnderCaret);
|
|
||||||
if ( m_blinkedOut )
|
if ( m_blinkedOut )
|
||||||
{
|
{
|
||||||
// restore the old image
|
// restore the old image
|
||||||
dcWin.Blit(m_xOld, m_yOld, m_width, m_height,
|
dcWin.DrawBitmap(m_bmpUnderCaret, m_xOld, m_yOld);
|
||||||
&dcMem, 0, 0);
|
|
||||||
m_xOld =
|
m_xOld =
|
||||||
m_yOld = -1;
|
m_yOld = -1;
|
||||||
}
|
}
|
||||||
@@ -257,6 +254,7 @@ void wxCaret::Refresh()
|
|||||||
{
|
{
|
||||||
if ( m_xOld == -1 && m_yOld == -1 )
|
if ( m_xOld == -1 && m_yOld == -1 )
|
||||||
{
|
{
|
||||||
|
wxMemoryDC dcMem(m_bmpUnderCaret);
|
||||||
// save the part we're going to overdraw
|
// save the part we're going to overdraw
|
||||||
dcMem.Blit(0, 0, m_width, m_height,
|
dcMem.Blit(0, 0, m_width, m_height,
|
||||||
&dcWin, m_x, m_y);
|
&dcWin, m_x, m_y);
|
||||||
|
|||||||
Reference in New Issue
Block a user