Browse Source

Don't walk text/labels when mirroring

We have a fixed bottom-align for the text and labels in eeschema.
Therefore, mirroring vertically needs to account for the text's offset
from the bounding box center.

Fixes https://gitlab.com/kicad/code/kicad/issues/9208
6.0.7
Seth Hillbrand 4 years ago
parent
commit
3b04b602d9
  1. 15
      eeschema/tools/sch_edit_tool.cpp

15
eeschema/tools/sch_edit_tool.cpp

@ -792,6 +792,21 @@ int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
pin->MirrorHorizontally( sheet->GetBoundingBox().GetCenter().x );
}
}
else if( item->Type() == SCH_TEXT_T || item->Type() == SCH_LABEL_T )
{
/// Text and Labels are aligned to their bottom right corners and we don't flip the
/// alignment corner, so we need to offset this in the vertical direction
wxPoint textMirrorPoint = mirrorPoint;
textMirrorPoint.y += item->GetBoundingBox().GetHeight() / 2;
textMirrorPoint = m_frame->GetNearestHalfGridPosition( textMirrorPoint );
if( vertical )
item->MirrorVertically( textMirrorPoint.y );
else
item->MirrorHorizontally( textMirrorPoint.x );
}
else
{
if( vertical )

Loading…
Cancel
Save