Do not change orientation when moving orthogonal dimensions
Fixes https://gitlab.com/kicad/code/kicad/issues/7727
This commit is contained in:
parent
bbd6a1db0e
commit
81570e02f3
|
@ -736,9 +736,6 @@ void ORTHOGONAL_DIMENSION::updateGeometry()
|
||||||
|
|
||||||
addShape( SHAPE_SEGMENT( extStart, extStart + extension.Resize( extensionHeight ) ) );
|
addShape( SHAPE_SEGMENT( extStart, extStart + extension.Resize( extensionHeight ) ) );
|
||||||
|
|
||||||
//##
|
|
||||||
//UpdateHeight(m_crossBarStart, m_crossBarEnd);
|
|
||||||
|
|
||||||
// Update text after calculating crossbar position but before adding crossbar lines
|
// Update text after calculating crossbar position but before adding crossbar lines
|
||||||
updateText();
|
updateText();
|
||||||
|
|
||||||
|
@ -806,12 +803,9 @@ void ORTHOGONAL_DIMENSION::updateText()
|
||||||
VECTOR2D height( m_crossBarStart - GetStart() );
|
VECTOR2D height( m_crossBarStart - GetStart() );
|
||||||
VECTOR2D crossBar( m_crossBarEnd - m_crossBarStart );
|
VECTOR2D crossBar( m_crossBarEnd - m_crossBarStart );
|
||||||
|
|
||||||
if( height.Cross( crossBar ) > 0 )
|
double sign = height.Cross( crossBar ) > 0 ? 1 : -1;
|
||||||
m_height = height.EuclideanNorm();
|
double rotation = sign * DEG2RAD( -90 );
|
||||||
else
|
|
||||||
m_height = -height.EuclideanNorm();
|
|
||||||
|
|
||||||
double rotation = sign( m_height ) * DEG2RAD( -90 );
|
|
||||||
VECTOR2I textOffset = crossbarCenter.Rotate( rotation ).Resize( textOffsetDistance );
|
VECTOR2I textOffset = crossbarCenter.Rotate( rotation ).Resize( textOffsetDistance );
|
||||||
textOffset += crossbarCenter;
|
textOffset += crossbarCenter;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue