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 1087 of file pcb_point_editor.cpp.
|
inline |
Definition at line 1090 of file pcb_point_editor.cpp.
References m_dimension, m_oldCrossBar, and m_originalTextPos.
|
inlineprivate |
Definition at line 1141 of file pcb_point_editor.cpp.
References KIGEOM::GetLengthRatioFromStart(), KIGEOM::GetNearestEndpoint(), GetRotated(), m_dimension, m_oldCrossBar, m_originalTextPos, KIGEOM::PointIsInDirection(), and KIGEOM::PointProjectsOntoSegment().
Referenced by UpdateTextAfterChange().
|
inline |
Definition at line 1096 of file pcb_point_editor.cpp.
References getDimensionNewTextPosition(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, m_dimension, m_oldCrossBar, m_originalTextPos, 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 1184 of file pcb_point_editor.cpp.
Referenced by DIM_ALIGNED_TEXT_UPDATER(), getDimensionNewTextPosition(), and UpdateTextAfterChange().
|
private |
Definition at line 1186 of file pcb_point_editor.cpp.
Referenced by DIM_ALIGNED_TEXT_UPDATER(), getDimensionNewTextPosition(), and UpdateTextAfterChange().
|
private |
Definition at line 1185 of file pcb_point_editor.cpp.
Referenced by DIM_ALIGNED_TEXT_UPDATER(), getDimensionNewTextPosition(), and UpdateTextAfterChange().