From 5897580c13fb2ef6cfbde274bf8af3947a78fa82 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 8 Nov 2015 11:10:52 +0100 Subject: [PATCH] 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. --- eeschema/lib_text.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index 10c831b241..e931a1f48d 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -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;