- // TBD:: preallocate bit larger bitmap at once, to avoid
- // excessive realocations later
-
- // check whether the given area is oriented horizontally
- // or verticallya and choose correspoinding bitmap to create or
- // recreate
-
- if ( forArea.height > forArea.width )
- {
- wxSize prevDim( 0,0 );
-
- if ( mpVertBuf )
- {
- prevDim.x = mpVertBuf->GetWidth();
- prevDim.y = mpVertBuf->GetHeight();
-
- mpVertBufDc->SelectObject( wxNullBitmap );
- delete mpVertBuf;
- }
- else
- mpVertBufDc = new wxMemoryDC();
-
- mpVertBuf = new wxBitmap( int( wxMax(forArea.width, prevDim.x ) ),
- int( wxMax(forArea.height, prevDim.y ) )
- );
-
- mpVertBufDc->SelectObject( *mpVertBuf );
-
- return mpVertBufDc;
- }
- else
- {
- wxSize prevDim( 0,0 );
-
- if ( mpHorizBuf )
- {
- prevDim.x = mpHorizBuf->GetWidth();
- prevDim.y = mpHorizBuf->GetHeight();
-
- mpHorizBufDc->SelectObject( wxNullBitmap );
- delete mpHorizBuf;
- }
- else
- mpHorizBufDc = new wxMemoryDC();
-
- mpHorizBuf = new wxBitmap( int( wxMax(forArea.width, prevDim.x ) ),
- int( wxMax(forArea.height, prevDim.y ) )
- );
-
- mpHorizBufDc->SelectObject( *mpHorizBuf );
-
- return mpHorizBufDc;
- }
+ // TBD:: preallocate bit larger bitmap at once, to avoid
+ // excessive realocations later
+
+ // check whether the given area is oriented horizontally
+ // or vertically and choose corresponding bitmap to create or
+ // recreate
+
+ if ( forArea.height > forArea.width )
+ {
+ wxSize prevDim( 0,0 );
+
+ if ( mpVertBuf )
+ {
+ prevDim.x = mpVertBuf->GetWidth();
+ prevDim.y = mpVertBuf->GetHeight();
+
+ mpVertBufDc->SelectObject( wxNullBitmap );
+ delete mpVertBuf;
+ }
+ else
+ mpVertBufDc = new wxMemoryDC();
+
+ mpVertBuf = new wxBitmap( int( wxMax(forArea.width, prevDim.x ) ),
+ int( wxMax(forArea.height, prevDim.y ) )
+ );
+
+ mpVertBufDc->SelectObject( *mpVertBuf );
+
+ return mpVertBufDc;
+ }
+ else
+ {
+ wxSize prevDim( 0,0 );
+
+ if ( mpHorizBuf )
+ {
+ prevDim.x = mpHorizBuf->GetWidth();
+ prevDim.y = mpHorizBuf->GetHeight();
+
+ mpHorizBufDc->SelectObject( wxNullBitmap );
+ delete mpHorizBuf;
+ }
+ else
+ mpHorizBufDc = new wxMemoryDC();
+
+ mpHorizBuf = new wxBitmap( int( wxMax(forArea.width, prevDim.x ) ),
+ int( wxMax(forArea.height, prevDim.y ) )
+ );
+
+ mpHorizBufDc->SelectObject( *mpHorizBuf );
+
+ return mpHorizBufDc;
+ }