Skip to content

Commit

Permalink
Piano win should not appear as desktop window under X. Fix CompassWin
Browse files Browse the repository at this point in the history
rotated icon under GTK.
  • Loading branch information
JesperWe committed Jun 15, 2012
1 parent e286112 commit 7b44408
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/styles.h
Expand Up @@ -41,6 +41,7 @@ enum StyleToolIconTypes
TOOLICON_ACTIVE
};

void bmdump( wxBitmap bm, wxString name );
wxBitmap MergeBitmaps( wxBitmap back, wxBitmap front, wxSize offset );
wxBitmap ConvertTo24Bit( wxColor bgColor, wxBitmap front );

Expand Down
4 changes: 2 additions & 2 deletions src/compasswin.cpp
Expand Up @@ -170,13 +170,12 @@ wxBitmap ocpnFloatingCompassWindow::CreateBmp()
if( g_bCourseUp ) BMPRose = style->GetIcon( _T("CompassRose") );
else
BMPRose = style->GetIcon( _T("CompassRoseBlue") );

if( ( fabs( cc1->GetVPRotation() ) > .01 ) || ( fabs( cc1->GetVPSkew() ) > .01 ) ) {
wxPoint rot_ctr( BMPRose.GetWidth() / 2, BMPRose.GetHeight() / 2 );
wxImage rose_img = BMPRose.ConvertToImage();

wxImage rot_image = rose_img.Rotate( rose_angle, rot_ctr, true, &after_rotate );
BMPRose = wxBitmap( rot_image );
BMPRose = wxBitmap( rot_image ).GetSubBitmap( wxRect(0, 0, BMPRose.GetWidth(), BMPRose.GetHeight()) );
}

wxBitmap iconBm;
Expand All @@ -186,6 +185,7 @@ wxBitmap ocpnFloatingCompassWindow::CreateBmp()
} else {
iconBm = BMPRose;
}

mdc.DrawBitmap( iconBm, offset );
offset.x += iconBm.GetWidth();

Expand Down
2 changes: 1 addition & 1 deletion src/statwin.cpp
Expand Up @@ -56,7 +56,7 @@ END_EVENT_TABLE()
// ctor
StatWin::StatWin( wxWindow *frame ) :
wxDialog( frame, wxID_ANY, _T(""), wxPoint( 20, 20 ), wxSize( 5, 5 ),
wxSIMPLE_BORDER | wxFRAME_SHAPED )
wxSIMPLE_BORDER | wxFRAME_SHAPED | wxFRAME_NO_TASKBAR )

{
int x, y;
Expand Down

0 comments on commit 7b44408

Please sign in to comment.