本文整理汇总了C++中EDA_RECT::GetEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ EDA_RECT::GetEnd方法的具体用法?C++ EDA_RECT::GetEnd怎么用?C++ EDA_RECT::GetEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDA_RECT
的用法示例。
在下文中一共展示了EDA_RECT::GetEnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawGraphic
void LIB_TEXT::drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode, void* aData,
const TRANSFORM& aTransform )
{
EDA_COLOR_T color = GetDefaultColor();
if( aColor < 0 ) // Used normal color or selected color
{
if( IsSelected() )
color = GetItemSelectedColor();
}
else
{
color = aColor;
}
GRSetDrawMode( aDC, aDrawMode );
/* Calculate the text orientation, according to the component
* orientation/mirror (needed when draw text in schematic)
*/
int orient = m_Orient;
if( aTransform.y1 ) // Rotate component 90 degrees.
{
if( orient == TEXT_ORIENT_HORIZ )
orient = TEXT_ORIENT_VERT;
else
orient = TEXT_ORIENT_HORIZ;
}
/* Calculate the text justification, according to the component
* orientation/mirror this is a bit complicated due to cumulative
* calculations:
* - numerous cases (mirrored or not, rotation)
* - the DrawGraphicText function recalculate also H and H justifications
* according to the text orientation.
* - When a component is mirrored, the text is not mirrored and
* justifications are complicated to calculate
* so the more easily way is to use no justifications ( Centered text )
* and use GetBoundaryBox to know the text coordinate considered as centered
*/
EDA_RECT bBox = GetBoundingBox();
wxPoint txtpos = bBox.Centre();
// Calculate pos accordint to mirror/rotation.
txtpos = aTransform.TransformCoordinate( txtpos ) + aOffset;
EDA_RECT* clipbox = aPanel? aPanel->GetClipBox() : NULL;
DrawGraphicText( clipbox, aDC, txtpos, (EDA_COLOR_T) color, m_Text, orient, m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GetPenSize(),
m_Italic, m_Bold );
/* Enable this to draw the bounding box around the text field to validate
* the bounding box calculations.
*/
#if 0
EDA_RECT grBox;
grBox.SetOrigin( aTransform.TransformCoordinate( bBox.GetOrigin() ) );
grBox.SetEnd( aTransform.TransformCoordinate( bBox.GetEnd() ) );
grBox.Move( aOffset );
GRRect( clipbox, aDC, grBox, 0, LIGHTMAGENTA );
#endif
}