KiCad PCB EDA Suite
|
Class to help update the text position of a dimension when the crossbar changes. More...
Public Member Functions | |
DIM_ALIGNED_TEXT_UPDATER (PCB_DIM_ALIGNED &aDimension) | |
void | UpdateTextAfterChange () |
Private Member Functions | |
VECTOR2I | getDimensionNewTextPosition () |
Private Attributes | |
PCB_DIM_ALIGNED & | m_dimension |
const VECTOR2I | m_originalTextPos |
const SEG | m_oldCrossBar |
Class to help update the text position of a dimension when the crossbar changes.
Choosing the right way to update the text position requires some care, and needs to hold some state from the original dimension position so the text can be placed in a similar position relative to the new crossbar. This class handles that state and the logic to find the new text position.
Definition at line 1287 of file pcb_point_editor.cpp.
|
inline |
Definition at line 1290 of file pcb_point_editor.cpp.
|
inlineprivate |
Definition at line 1342 of file pcb_point_editor.cpp.
References SEG::A, SEG::B, SEG::Center(), PCB_DIM_ALIGNED::GetCrossbarEnd(), PCB_DIM_ALIGNED::GetCrossbarStart(), KIGEOM::GetLengthRatioFromStart(), KIGEOM::GetNearestEndpoint(), GetRotated(), m_dimension, m_oldCrossBar, m_originalTextPos, SEG::NearestPoint(), KIGEOM::PointIsInDirection(), and KIGEOM::PointProjectsOntoSegment().
Referenced by UpdateTextAfterChange().
|
inline |
Definition at line 1296 of file pcb_point_editor.cpp.
References PCB_DIM_ALIGNED::GetCrossbarEnd(), PCB_DIM_ALIGNED::GetCrossbarStart(), getDimensionNewTextPosition(), EDA_TEXT::GetHorizJustify(), SEG::LineProject(), m_dimension, m_oldCrossBar, m_originalTextPos, SEG::NearestPoint(), EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetTextPos(), PCB_DIMENSION_BASE::Update(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR::updateAlignedDimension(), and ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR::updateOrthogonalDimension().
|
private |
Definition at line 1389 of file pcb_point_editor.cpp.
Referenced by getDimensionNewTextPosition(), and UpdateTextAfterChange().
|
private |
Definition at line 1391 of file pcb_point_editor.cpp.
Referenced by getDimensionNewTextPosition(), and UpdateTextAfterChange().
|
private |
Definition at line 1390 of file pcb_point_editor.cpp.
Referenced by getDimensionNewTextPosition(), and UpdateTextAfterChange().