LIB_TEXT::Plot doesn't take justification into account, so when generating postscript/PDF/etc with left/right-justified text, the text is in the wrong position. This rev fixes that.

This commit is contained in:
unknown 2015-11-08 11:10:52 +01:00 committed by jean-pierre charras
parent 2cfa79e52f
commit 5897580c13
1 changed files with 6 additions and 1 deletions

View File

@ -307,10 +307,15 @@ void LIB_TEXT::Plot( PLOTTER* plotter, const wxPoint& offset, bool fill,
{
wxASSERT( plotter != NULL );
EDA_RECT bBox = GetBoundingBox();
// convert coordinates from draw Y axis to libedit Y axis
bBox.RevertYAxis();
wxPoint txtpos = bBox.Centre();
/* The text orientation may need to be flipped if the
* transformation matrix causes xy axes to be flipped. */
int t1 = ( aTransform.x1 != 0 ) ^ ( m_Orient != 0 );
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + offset;
wxPoint pos = aTransform.TransformCoordinate( txtpos ) + offset;
// Get color
EDA_COLOR_T color;