Fix mirrored graphics when moving SCH_BITMAP on OS X

Fixes: https://bugs.launchpad.net/kicad/+bug/1529163
This commit is contained in:
Simon Wells 2016-05-17 17:56:20 -04:00 committed by Chris Pavlina
parent daa0d391de
commit 74611440b5
1 changed files with 11 additions and 2 deletions

View File

@ -191,14 +191,23 @@ void SCH_BITMAP::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset
{
wxPoint pos = m_Pos + aOffset;
GRSetDrawMode( aDC, aDrawMode );
if( aColor < 0 ) // Use normal drawing function
{
// https://bugs.launchpad.net/kicad/+bug/1529163
// "Moving images in eeschema on OS X uses
// wrong position and shows image flipped"
//
// Original fix was to only GRSetDrawMode if aColor >= 0, but this made
// moving SCH_BITMAP work poorly on other platforms.
#ifndef __WXMAC__
GRSetDrawMode( aDC, aDrawMode );
#endif
m_Image->DrawBitmap( aPanel, aDC, pos );
}
else // draws bounding box only (used to move items)
{
GRSetDrawMode( aDC, aDrawMode );
// To draw the rect, pos is the upper left corner position
wxSize size = m_Image->GetSize();
pos.x -= size.x / 2;