mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-07 22:35:32 +00:00
TextBoxes for PCBNew.
This commit is contained in:
parent
60bcfd1bf1
commit
5739505aa3
3d-viewer
3d_canvas
3d_rendering/raytracing/shapes2D
common
eeschema
dialogs
dialog_field_properties_base.cppdialog_field_properties_base.fbpdialog_lib_text_properties_base.cppdialog_lib_text_properties_base.fbpdialog_lib_textbox_properties_base.cppdialog_lib_textbox_properties_base.fbp
lib_textbox.cppsch_field.cppsch_field.hsch_textbox.cppinclude
pcbnew
CMakeLists.txtarray_creator.cppboard.cppboard_commit.cppcollectors.cppcross-probing.cpp
dialogs
dialog_global_deletion.cppdialog_global_edit_text_and_graphics.cppdialog_textbox_properties.cppdialog_textbox_properties.hdialog_textbox_properties_base.cppdialog_textbox_properties_base.fbpdialog_textbox_properties_base.h
drc
edit.cppexporters
footprint.cppfootprint_edit_frame.cppfootprint_editor_utils.cppfootprint_libraries_utils.cppfp_shape.cppfp_shape.hfp_textbox.cppfp_textbox.hkicad_clipboard.cppmenubar_footprint_editor.cppmenubar_pcb_editor.cpppcb_base_edit_frame.hpcb_base_frame.cpppcb_edit_frame.cpppcb_painter.cpppcb_painter.hpcb_shape.cpppcb_shape.hpcb_text.cpppcb_text.hpcb_textbox.cpppcb_textbox.hpcbplot.hplot_board_layers.cppplot_brditems_plotter.cppplugins/kicad
router
toolbars_footprint_editor.cpptoolbars_pcb_editor.cpptools
drawing_tool.cppedit_tool.cppgroup_tool.cpppcb_actions.cpppcb_actions.hpcb_control.cpppcb_grid_helper.cpppcb_point_editor.cpppcb_selection_tool.cpppcb_viewer_tools.cpp
zone_filler.cppqa/pcbnew
@ -479,18 +479,21 @@ private:
|
||||
void addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aDstContainer,
|
||||
PCB_LAYER_ID aLayerId );
|
||||
|
||||
void addShape( const PCB_TEXT* aText, CONTAINER_2D_BASE* aDstContainer );
|
||||
void addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aDstContainer,
|
||||
const BOARD_ITEM* aOwner );
|
||||
|
||||
void addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aDstContainer );
|
||||
void addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aContainer,
|
||||
const BOARD_ITEM* aOwner );
|
||||
|
||||
void addShape( const PCB_DIMENSION_BASE* aDimension, CONTAINER_2D_BASE* aDstContainer );
|
||||
void addShape( const PCB_DIMENSION_BASE* aDimension, CONTAINER_2D_BASE* aDstContainer,
|
||||
const BOARD_ITEM* aOwner );
|
||||
|
||||
void addSolidAreasShapes( const ZONE* aZoneContainer, CONTAINER_2D_BASE* aDstContainer,
|
||||
void addSolidAreasShapes( const ZONE* aZone, CONTAINER_2D_BASE* aDstContainer,
|
||||
PCB_LAYER_ID aLayerId );
|
||||
|
||||
void transformArcToSegments( const VECTOR2I& aCentre, const VECTOR2I& aStart,
|
||||
const EDA_ANGLE& aArcAngle, int aCircleToSegmentsCount, int aWidth,
|
||||
CONTAINER_2D_BASE* aDstContainer, const BOARD_ITEM& aBoardItem );
|
||||
CONTAINER_2D_BASE* aDstContainer, const BOARD_ITEM& aOwner );
|
||||
|
||||
void buildPadOutlineAsSegments( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer, int aWidth );
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "../3d_rendering/raytracing/shapes2D/filled_circle_2d.h"
|
||||
#include "../3d_rendering/raytracing/shapes2D/round_segment_2d.h"
|
||||
#include "../3d_rendering/raytracing/shapes2D/triangle_2d.h"
|
||||
#include "fp_textbox.h"
|
||||
#include <board_adapter.h>
|
||||
#include <footprint.h>
|
||||
#include <pad.h>
|
||||
@ -55,42 +56,49 @@
|
||||
#include <macros.h>
|
||||
#include <callback_gal.h>
|
||||
|
||||
void BOARD_ADAPTER::addShape( const PCB_TEXT* aText, CONTAINER_2D_BASE* aDstContainer )
|
||||
|
||||
#define TO_3DU( x ) ( x * m_biuTo3Dunits )
|
||||
|
||||
#define TO_SFVEC2F( vec ) SFVEC2F( TO_3DU( vec.x ), TO_3DU( -vec.y ) )
|
||||
|
||||
|
||||
void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContainer,
|
||||
const BOARD_ITEM* aOwner )
|
||||
{
|
||||
KIGFX::GAL_DISPLAY_OPTIONS empty_opts;
|
||||
KIFONT::FONT* font = aText->GetDrawFont();
|
||||
float penWidth = aText->GetEffectiveTextPenWidth() * m_biuTo3Dunits;
|
||||
float penWidth = TO_3DU( aText->GetEffectiveTextPenWidth() );
|
||||
|
||||
CALLBACK_GAL callback_gal( empty_opts,
|
||||
// Stroke callback
|
||||
[&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2 )
|
||||
{
|
||||
const SFVEC2F a3DU( aPt1.x * m_biuTo3Dunits, -aPt1.y * m_biuTo3Dunits );
|
||||
const SFVEC2F b3DU( aPt2.x * m_biuTo3Dunits, -aPt2.y * m_biuTo3Dunits );
|
||||
const SFVEC2F pt1_3DU = TO_SFVEC2F( aPt1 );
|
||||
const SFVEC2F pt2_3DU = TO_SFVEC2F( aPt2 );
|
||||
|
||||
if( Is_segment_a_circle( a3DU, b3DU ) )
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( a3DU, penWidth / 2, *aText ) );
|
||||
if( Is_segment_a_circle( pt1_3DU, pt2_3DU ) )
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( pt1_3DU, penWidth / 2, *aOwner ) );
|
||||
else
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( a3DU, b3DU, penWidth, *aText ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( pt1_3DU, pt2_3DU, penWidth, *aOwner ) );
|
||||
},
|
||||
// Triangulation callback
|
||||
[&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2, const VECTOR2I& aPt3 )
|
||||
{
|
||||
const SFVEC2F a3DU( aPt1.x * m_biuTo3Dunits, -aPt1.y * m_biuTo3Dunits );
|
||||
const SFVEC2F b3DU( aPt2.x * m_biuTo3Dunits, -aPt2.y * m_biuTo3Dunits );
|
||||
const SFVEC2F c3DU( aPt3.x * m_biuTo3Dunits, -aPt3.y * m_biuTo3Dunits );
|
||||
|
||||
aDstContainer->Add( new TRIANGLE_2D( a3DU, b3DU, c3DU, *aText ) );
|
||||
aContainer->Add( new TRIANGLE_2D( TO_SFVEC2F( aPt1 ), TO_SFVEC2F( aPt2 ),
|
||||
TO_SFVEC2F( aPt3 ), *aOwner ) );
|
||||
} );
|
||||
|
||||
font->Draw( &callback_gal, aText->GetShownText(), aText->GetTextPos(), aText->GetAttributes() );
|
||||
TEXT_ATTRIBUTES attrs = aText->GetAttributes();
|
||||
attrs.m_Angle = aText->GetDrawRotation();
|
||||
|
||||
font->Draw( &callback_gal, aText->GetShownText(), aText->GetDrawPos(), attrs );
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::addShape( const PCB_DIMENSION_BASE* aDimension,
|
||||
CONTAINER_2D_BASE* aDstContainer )
|
||||
void BOARD_ADAPTER::addShape( const PCB_DIMENSION_BASE* aDimension, CONTAINER_2D_BASE* aContainer,
|
||||
const BOARD_ITEM* aOwner )
|
||||
{
|
||||
addShape( &aDimension->Text(), aDstContainer );
|
||||
addText( &aDimension->Text(), aContainer, aDimension );
|
||||
|
||||
const int linewidth = aDimension->GetLineThickness();
|
||||
|
||||
@ -100,12 +108,10 @@ void BOARD_ADAPTER::addShape( const PCB_DIMENSION_BASE* aDimension,
|
||||
{
|
||||
case SH_SEGMENT:
|
||||
{
|
||||
const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
|
||||
const SFVEC2F start3DU( seg.A.x * m_biuTo3Dunits, -seg.A.y * m_biuTo3Dunits );
|
||||
const SFVEC2F end3DU ( seg.B.x * m_biuTo3Dunits, -seg.B.y * m_biuTo3Dunits );
|
||||
const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
|
||||
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, linewidth * m_biuTo3Dunits,
|
||||
*aDimension ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( TO_SFVEC2F( seg.A ), TO_SFVEC2F( seg.B ),
|
||||
TO_3DU( linewidth ), *aOwner ) );
|
||||
break;
|
||||
}
|
||||
|
||||
@ -114,12 +120,8 @@ void BOARD_ADAPTER::addShape( const PCB_DIMENSION_BASE* aDimension,
|
||||
int radius = static_cast<const SHAPE_CIRCLE*>( shape.get() )->GetRadius();
|
||||
int delta = aDimension->GetLineThickness() / 2;
|
||||
|
||||
SFVEC2F center( shape->Centre().x * m_biuTo3Dunits,
|
||||
shape->Centre().y * m_biuTo3Dunits );
|
||||
|
||||
aDstContainer->Add( new RING_2D( center, ( radius - delta ) * m_biuTo3Dunits,
|
||||
( radius + delta ) * m_biuTo3Dunits, *aDimension ) );
|
||||
|
||||
aContainer->Add( new RING_2D( TO_SFVEC2F( shape->Centre() ), TO_3DU( radius - delta ),
|
||||
TO_3DU( radius + delta ), *aOwner ) );
|
||||
break;
|
||||
}
|
||||
|
||||
@ -130,41 +132,16 @@ void BOARD_ADAPTER::addShape( const PCB_DIMENSION_BASE* aDimension,
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint,
|
||||
CONTAINER_2D_BASE* aDstContainer, PCB_LAYER_ID aLayerId )
|
||||
void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aContainer,
|
||||
PCB_LAYER_ID aLayerId )
|
||||
{
|
||||
KIGFX::GAL_DISPLAY_OPTIONS empty_opts;
|
||||
std::vector<FP_TEXT*> textItems;
|
||||
FP_TEXT* textItem = nullptr;
|
||||
float penWidth = 0;
|
||||
|
||||
CALLBACK_GAL callback_gal( empty_opts,
|
||||
// Stroke callback
|
||||
[&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2 )
|
||||
{
|
||||
const SFVEC2F a3DU( aPt1.x * m_biuTo3Dunits, -aPt1.y * m_biuTo3Dunits );
|
||||
const SFVEC2F b3DU( aPt2.x * m_biuTo3Dunits, -aPt2.y * m_biuTo3Dunits );
|
||||
|
||||
if( Is_segment_a_circle( a3DU, b3DU ) )
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( a3DU, penWidth / 2, *textItem ) );
|
||||
else
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( a3DU, b3DU, penWidth, *textItem ) );
|
||||
},
|
||||
// Triangulation callback
|
||||
[&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2, const VECTOR2I& aPt3 )
|
||||
{
|
||||
const SFVEC2F a3DU( aPt1.x * m_biuTo3Dunits, -aPt1.y * m_biuTo3Dunits );
|
||||
const SFVEC2F b3DU( aPt2.x * m_biuTo3Dunits, -aPt2.y * m_biuTo3Dunits );
|
||||
const SFVEC2F c3DU( aPt3.x * m_biuTo3Dunits, -aPt3.y * m_biuTo3Dunits );
|
||||
|
||||
aDstContainer->Add( new TRIANGLE_2D( a3DU, b3DU, c3DU, *textItem ) );
|
||||
} );
|
||||
|
||||
if( aFootprint->Reference().GetLayer() == aLayerId && aFootprint->Reference().IsVisible() )
|
||||
textItems.push_back( &aFootprint->Reference() );
|
||||
addText( &aFootprint->Reference(), aContainer, &aFootprint->Reference() );
|
||||
|
||||
if( aFootprint->Value().GetLayer() == aLayerId && aFootprint->Value().IsVisible() )
|
||||
textItems.push_back( &aFootprint->Value() );
|
||||
addText( &aFootprint->Value(), aContainer, &aFootprint->Value() );
|
||||
|
||||
for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
|
||||
{
|
||||
@ -175,7 +152,20 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint,
|
||||
FP_TEXT* text = static_cast<FP_TEXT*>( item );
|
||||
|
||||
if( text->GetLayer() == aLayerId && text->IsVisible() )
|
||||
textItems.push_back( text );
|
||||
addText( text, aContainer, text );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PCB_FP_TEXTBOX_T:
|
||||
{
|
||||
FP_TEXTBOX* textbox = static_cast<FP_TEXTBOX*>( item );
|
||||
|
||||
if( textbox->GetLayer() == aLayerId )
|
||||
{
|
||||
addShape( textbox, aContainer, aFootprint );
|
||||
addText( textbox, aContainer, aFootprint );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@ -189,7 +179,7 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint,
|
||||
PCB_DIMENSION_BASE* dimension = static_cast<PCB_DIMENSION_BASE*>( item );
|
||||
|
||||
if( dimension->GetLayer() == aLayerId )
|
||||
addShape( dimension, aDstContainer );
|
||||
addShape( dimension, aContainer, aFootprint );
|
||||
|
||||
break;
|
||||
}
|
||||
@ -199,7 +189,7 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint,
|
||||
FP_SHAPE* shape = static_cast<FP_SHAPE*>( item );
|
||||
|
||||
if( shape->GetLayer() == aLayerId )
|
||||
addShape( static_cast<const PCB_SHAPE*>( shape ), aDstContainer );
|
||||
addShape( shape, aContainer, aFootprint );
|
||||
|
||||
break;
|
||||
}
|
||||
@ -208,32 +198,19 @@ void BOARD_ADAPTER::addFootprintShapes( const FOOTPRINT* aFootprint,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for( FP_TEXT* text : textItems )
|
||||
{
|
||||
textItem = text;
|
||||
penWidth = textItem->GetEffectiveTextPenWidth() * m_biuTo3Dunits;
|
||||
|
||||
KIFONT::FONT* font = textItem->GetDrawFont();
|
||||
TEXT_ATTRIBUTES attrs = textItem->GetAttributes();
|
||||
|
||||
attrs.m_Angle = textItem->GetDrawRotation();
|
||||
|
||||
font->Draw( &callback_gal, textItem->GetShownText(), textItem->GetTextPos(), attrs );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::createTrack( const PCB_TRACK* aTrack, CONTAINER_2D_BASE* aDstContainer )
|
||||
{
|
||||
SFVEC2F start3DU( aTrack->GetStart().x * m_biuTo3Dunits,
|
||||
-aTrack->GetStart().y * m_biuTo3Dunits ); // y coord is inverted
|
||||
SFVEC2F start3DU = TO_SFVEC2F( aTrack->GetStart() );
|
||||
SFVEC2F end3DU = TO_SFVEC2F( aTrack->GetEnd() );
|
||||
|
||||
switch( aTrack->Type() )
|
||||
{
|
||||
case PCB_VIA_T:
|
||||
{
|
||||
const float radius3DU = ( aTrack->GetWidth() / 2 ) * m_biuTo3Dunits;
|
||||
const float radius3DU = TO_3DU( aTrack->GetWidth() / 2 );
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( start3DU, radius3DU, *aTrack ) );
|
||||
break;
|
||||
}
|
||||
@ -267,20 +244,16 @@ void BOARD_ADAPTER::createTrack( const PCB_TRACK* aTrack, CONTAINER_2D_BASE* aDs
|
||||
|
||||
case PCB_TRACE_T: // Track is a usual straight segment
|
||||
{
|
||||
SFVEC2F end3DU( aTrack->GetEnd().x * m_biuTo3Dunits, -aTrack->GetEnd().y * m_biuTo3Dunits );
|
||||
|
||||
// Cannot add segments that have the same start and end point
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
{
|
||||
const float radius3DU = ( aTrack->GetWidth() / 2 ) * m_biuTo3Dunits;
|
||||
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( start3DU, radius3DU, *aTrack ) );
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( start3DU, TO_3DU( aTrack->GetWidth() / 2 ),
|
||||
*aTrack ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
const float width3DU = aTrack->GetWidth() * m_biuTo3Dunits;
|
||||
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, width3DU, *aTrack ) );
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, TO_3DU( aTrack->GetWidth() ),
|
||||
*aTrack ) );
|
||||
}
|
||||
|
||||
break;
|
||||
@ -292,7 +265,7 @@ void BOARD_ADAPTER::createTrack( const PCB_TRACK* aTrack, CONTAINER_2D_BASE* aDs
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer,
|
||||
void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aContainer,
|
||||
PCB_LAYER_ID aLayer, const VECTOR2I& aMargin ) const
|
||||
{
|
||||
SHAPE_POLY_SET poly;
|
||||
@ -329,37 +302,34 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aDs
|
||||
{
|
||||
case SH_SEGMENT:
|
||||
{
|
||||
const SHAPE_SEGMENT* seg = (SHAPE_SEGMENT*) shape;
|
||||
const SHAPE_SEGMENT* seg = static_cast<const SHAPE_SEGMENT*>( shape );
|
||||
|
||||
const SFVEC2F a3DU( seg->GetSeg().A.x * m_biuTo3Dunits,
|
||||
-seg->GetSeg().A.y * m_biuTo3Dunits );
|
||||
const SFVEC2F b3DU( seg->GetSeg().B.x * m_biuTo3Dunits,
|
||||
-seg->GetSeg().B.y * m_biuTo3Dunits );
|
||||
const double width3DU = ( seg->GetWidth() + clearance.x * 2 ) * m_biuTo3Dunits;
|
||||
const SFVEC2F a3DU = TO_SFVEC2F( seg->GetSeg().A );
|
||||
const SFVEC2F b3DU = TO_SFVEC2F( seg->GetSeg().B );
|
||||
const double width3DU = TO_3DU( seg->GetWidth() + clearance.x * 2 );
|
||||
|
||||
// Cannot add segments that have the same start and end point
|
||||
if( Is_segment_a_circle( a3DU, b3DU ) )
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( a3DU, width3DU / 2, *aPad ) );
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( a3DU, width3DU / 2, *aPad ) );
|
||||
else
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( a3DU, b3DU, width3DU, *aPad ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( a3DU, b3DU, width3DU, *aPad ) );
|
||||
}
|
||||
break;
|
||||
|
||||
case SH_CIRCLE:
|
||||
{
|
||||
const SHAPE_CIRCLE* circle = (SHAPE_CIRCLE*) shape;
|
||||
const SHAPE_CIRCLE* circle = static_cast<const SHAPE_CIRCLE*>( shape );
|
||||
|
||||
const double radius3DU = ( circle->GetRadius() + clearance.x ) * m_biuTo3Dunits;
|
||||
const SFVEC2F center3DU( circle->GetCenter().x * m_biuTo3Dunits,
|
||||
-circle->GetCenter().y * m_biuTo3Dunits );
|
||||
const double radius3DU = TO_3DU( circle->GetRadius() + clearance.x );
|
||||
const SFVEC2F center3DU = TO_SFVEC2F( circle->GetCenter() );
|
||||
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( center3DU, radius3DU, *aPad ) );
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( center3DU, radius3DU, *aPad ) );
|
||||
}
|
||||
break;
|
||||
|
||||
case SH_RECT:
|
||||
{
|
||||
SHAPE_RECT* rect = (SHAPE_RECT*) shape;
|
||||
const SHAPE_RECT* rect = static_cast<const SHAPE_RECT*>( shape );
|
||||
|
||||
poly.NewOutline();
|
||||
poly.Append( rect->GetPosition() );
|
||||
@ -379,23 +349,21 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aDs
|
||||
|
||||
case SH_ARC:
|
||||
{
|
||||
SHAPE_ARC* arc = (SHAPE_ARC*) shape;
|
||||
const SHAPE_ARC* arc = static_cast<const SHAPE_ARC*>( shape );
|
||||
SHAPE_LINE_CHAIN l = arc->ConvertToPolyline( maxError );
|
||||
|
||||
for( int i = 0; i < l.SegmentCount(); i++ )
|
||||
{
|
||||
SHAPE_SEGMENT seg( l.Segment( i ).A, l.Segment( i ).B, arc->GetWidth() );
|
||||
const SFVEC2F a3DU( seg.GetSeg().A.x * m_biuTo3Dunits,
|
||||
-seg.GetSeg().A.y * m_biuTo3Dunits );
|
||||
const SFVEC2F b3DU( seg.GetSeg().B.x * m_biuTo3Dunits,
|
||||
-seg.GetSeg().B.y * m_biuTo3Dunits );
|
||||
const double width3DU = ( arc->GetWidth() + clearance.x * 2 ) * m_biuTo3Dunits;
|
||||
const SFVEC2F a3DU = TO_SFVEC2F( seg.GetSeg().A );
|
||||
const SFVEC2F b3DU = TO_SFVEC2F( seg.GetSeg().B );
|
||||
const double width3DU = TO_3DU( arc->GetWidth() + clearance.x * 2 );
|
||||
|
||||
// Cannot add segments that have the same start and end point
|
||||
if( Is_segment_a_circle( a3DU, b3DU ) )
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( a3DU, width3DU / 2, *aPad ) );
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( a3DU, width3DU / 2, *aPad ) );
|
||||
else
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( a3DU, b3DU, width3DU, *aPad ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( a3DU, b3DU, width3DU, *aPad ) );
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -413,7 +381,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aDs
|
||||
poly.Inflate( clearance.x, 32 );
|
||||
|
||||
// Add the PAD polygon
|
||||
ConvertPolygonToTriangles( poly, *aDstContainer, m_biuTo3Dunits, *aPad );
|
||||
ConvertPolygonToTriangles( poly, *aContainer, m_biuTo3Dunits, *aPad );
|
||||
}
|
||||
}
|
||||
|
||||
@ -432,10 +400,7 @@ OBJECT_2D* BOARD_ADAPTER::createPadWithDrill( const PAD* aPad, int aInflateValue
|
||||
{
|
||||
const int radius = ( drillSize.x / 2 ) + aInflateValue;
|
||||
|
||||
const SFVEC2F center( aPad->GetPosition().x * m_biuTo3Dunits,
|
||||
-aPad->GetPosition().y * m_biuTo3Dunits );
|
||||
|
||||
return new FILLED_CIRCLE_2D( center, radius * m_biuTo3Dunits, *aPad );
|
||||
return new FILLED_CIRCLE_2D( TO_SFVEC2F( aPad->GetPosition() ), TO_3DU( radius ), *aPad );
|
||||
|
||||
}
|
||||
else // Oblong hole
|
||||
@ -443,20 +408,13 @@ OBJECT_2D* BOARD_ADAPTER::createPadWithDrill( const PAD* aPad, int aInflateValue
|
||||
const SHAPE_SEGMENT* seg = aPad->GetEffectiveHoleShape();
|
||||
float width = seg->GetWidth() + aInflateValue * 2;
|
||||
|
||||
SFVEC2F start3DU( seg->GetSeg().A.x * m_biuTo3Dunits,
|
||||
-seg->GetSeg().A.y * m_biuTo3Dunits );
|
||||
|
||||
SFVEC2F end3DU ( seg->GetSeg().B.x * m_biuTo3Dunits,
|
||||
-seg->GetSeg().B.y * m_biuTo3Dunits );
|
||||
|
||||
return new ROUND_SEGMENT_2D( start3DU, end3DU, width * m_biuTo3Dunits, *aPad );
|
||||
return new ROUND_SEGMENT_2D( TO_SFVEC2F( seg->GetSeg().A ), TO_SFVEC2F( seg->GetSeg().B ),
|
||||
TO_3DU( width ), *aPad );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::addPads( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aDstContainer,
|
||||
void BOARD_ADAPTER::addPads( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aContainer,
|
||||
PCB_LAYER_ID aLayerId, bool aSkipNPTHPadsWihNoCopper,
|
||||
bool aSkipPlatedPads, bool aSkipNonPlatedPads )
|
||||
{
|
||||
@ -523,7 +481,7 @@ void BOARD_ADAPTER::addPads( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aDs
|
||||
break;
|
||||
}
|
||||
|
||||
createPadWithMargin( pad, aDstContainer, aLayerId, margin );
|
||||
createPadWithMargin( pad, aContainer, aLayerId, margin );
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,8 +490,8 @@ void BOARD_ADAPTER::addPads( const FOOTPRINT* aFootprint, CONTAINER_2D_BASE* aDs
|
||||
// common/convert_basic_shapes_to_polygon.cpp
|
||||
void BOARD_ADAPTER::transformArcToSegments( const VECTOR2I& aCentre, const VECTOR2I& aStart,
|
||||
const EDA_ANGLE& aArcAngle, int aCircleToSegmentsCount,
|
||||
int aWidth, CONTAINER_2D_BASE* aDstContainer,
|
||||
const BOARD_ITEM& aBoardItem )
|
||||
int aWidth, CONTAINER_2D_BASE* aContainer,
|
||||
const BOARD_ITEM& aOwner )
|
||||
{
|
||||
VECTOR2I arc_start, arc_end;
|
||||
EDA_ANGLE arcAngle( aArcAngle );
|
||||
@ -559,43 +517,32 @@ void BOARD_ADAPTER::transformArcToSegments( const VECTOR2I& aCentre, const VECTO
|
||||
curr_end = arc_start;
|
||||
RotatePoint( curr_end, aCentre, -ii );
|
||||
|
||||
const SFVEC2F start3DU( curr_start.x * m_biuTo3Dunits, -curr_start.y * m_biuTo3Dunits );
|
||||
const SFVEC2F end3DU ( curr_end.x * m_biuTo3Dunits, -curr_end.y * m_biuTo3Dunits );
|
||||
const SFVEC2F start3DU = TO_SFVEC2F( curr_start );
|
||||
const SFVEC2F end3DU = TO_SFVEC2F( curr_end );
|
||||
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
{
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( start3DU, ( aWidth / 2 ) * m_biuTo3Dunits,
|
||||
aBoardItem ) );
|
||||
}
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( start3DU, TO_3DU( aWidth / 2 ), aOwner ) );
|
||||
else
|
||||
{
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, aWidth * m_biuTo3Dunits,
|
||||
aBoardItem ) );
|
||||
}
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, TO_3DU( aWidth ), aOwner ) );
|
||||
|
||||
curr_start = curr_end;
|
||||
}
|
||||
|
||||
if( curr_end != arc_end )
|
||||
{
|
||||
const SFVEC2F start3DU( curr_end.x * m_biuTo3Dunits, -curr_end.y * m_biuTo3Dunits );
|
||||
const SFVEC2F end3DU ( arc_end.x * m_biuTo3Dunits, -arc_end.y * m_biuTo3Dunits );
|
||||
const SFVEC2F start3DU = TO_SFVEC2F( curr_end );
|
||||
const SFVEC2F end3DU = TO_SFVEC2F( arc_end );
|
||||
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
{
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( start3DU, ( aWidth / 2 ) * m_biuTo3Dunits,
|
||||
aBoardItem ) );
|
||||
}
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( start3DU, TO_3DU( aWidth / 2 ), aOwner ) );
|
||||
else
|
||||
{
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, aWidth * m_biuTo3Dunits,
|
||||
aBoardItem ) );
|
||||
}
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, TO_3DU( aWidth ), aOwner ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aDstContainer )
|
||||
void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aContainer,
|
||||
const BOARD_ITEM* aOwner )
|
||||
{
|
||||
// The full width of the lines to create
|
||||
// The extra 1 protects the inner/outer radius values from degeneracy
|
||||
@ -605,19 +552,17 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aDstCo
|
||||
{
|
||||
case SHAPE_T::CIRCLE:
|
||||
{
|
||||
const SFVEC2F center3DU( aShape->GetCenter().x * m_biuTo3Dunits,
|
||||
-aShape->GetCenter().y * m_biuTo3Dunits );
|
||||
const SFVEC2F center3DU = TO_SFVEC2F( aShape->GetCenter() );
|
||||
float inner_radius3DU = TO_3DU( aShape->GetRadius() - linewidth / 2 );
|
||||
float outer_radius3DU = TO_3DU( aShape->GetRadius() + linewidth / 2 );
|
||||
|
||||
float inner_radius = ( aShape->GetRadius() - linewidth / 2 ) * m_biuTo3Dunits;
|
||||
float outer_radius = ( aShape->GetRadius() + linewidth / 2 ) * m_biuTo3Dunits;
|
||||
|
||||
if( inner_radius < 0 )
|
||||
inner_radius = 0;
|
||||
if( inner_radius3DU < 0 )
|
||||
inner_radius3DU = 0;
|
||||
|
||||
if( aShape->IsFilled() )
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( center3DU, outer_radius, *aShape ) );
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( center3DU, outer_radius3DU, *aOwner ) );
|
||||
else
|
||||
aDstContainer->Add( new RING_2D( center3DU, inner_radius, outer_radius, *aShape ) );
|
||||
aContainer->Add( new RING_2D( center3DU, inner_radius3DU, outer_radius3DU, *aOwner ) );
|
||||
}
|
||||
break;
|
||||
|
||||
@ -631,25 +576,20 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aDstCo
|
||||
|
||||
polyList.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
|
||||
ConvertPolygonToTriangles( polyList, *aDstContainer, m_biuTo3Dunits, *aShape );
|
||||
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<VECTOR2I> pts = aShape->GetRectCorners();
|
||||
|
||||
const SFVEC2F topLeft3DU( pts[0].x * m_biuTo3Dunits, -pts[0].y * m_biuTo3Dunits );
|
||||
const SFVEC2F topRight3DU( pts[1].x * m_biuTo3Dunits, -pts[1].y * m_biuTo3Dunits );
|
||||
const SFVEC2F botRight3DU( pts[2].x * m_biuTo3Dunits, -pts[2].y * m_biuTo3Dunits );
|
||||
const SFVEC2F botLeft3DU( pts[3].x * m_biuTo3Dunits, -pts[3].y * m_biuTo3Dunits );
|
||||
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( topLeft3DU, topRight3DU,
|
||||
linewidth * m_biuTo3Dunits, *aShape ) );
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( topRight3DU, botRight3DU,
|
||||
linewidth * m_biuTo3Dunits, *aShape ) );
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( botRight3DU, botLeft3DU,
|
||||
linewidth * m_biuTo3Dunits, *aShape ) );
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( botLeft3DU, topLeft3DU,
|
||||
linewidth * m_biuTo3Dunits, *aShape ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( TO_SFVEC2F( pts[0] ), TO_SFVEC2F( pts[1] ),
|
||||
TO_3DU( linewidth ), *aOwner ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( TO_SFVEC2F( pts[1] ), TO_SFVEC2F( pts[2] ),
|
||||
TO_3DU( linewidth ), *aOwner ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( TO_SFVEC2F( pts[2] ), TO_SFVEC2F( pts[3] ),
|
||||
TO_3DU( linewidth ), *aOwner ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( TO_SFVEC2F( pts[3] ), TO_SFVEC2F( pts[0] ),
|
||||
TO_3DU( linewidth ), *aOwner ) );
|
||||
}
|
||||
break;
|
||||
|
||||
@ -658,28 +598,20 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aDstCo
|
||||
unsigned int segCount = GetCircleSegmentCount( aShape->GetBoundingBox().GetSizeMax() );
|
||||
|
||||
transformArcToSegments( aShape->GetCenter(), aShape->GetStart(), aShape->GetArcAngle(),
|
||||
segCount, linewidth, aDstContainer, *aShape );
|
||||
segCount, linewidth, aContainer, *aOwner );
|
||||
}
|
||||
break;
|
||||
|
||||
case SHAPE_T::SEGMENT:
|
||||
{
|
||||
const SFVEC2F start3DU( aShape->GetStart().x * m_biuTo3Dunits,
|
||||
-aShape->GetStart().y * m_biuTo3Dunits );
|
||||
|
||||
const SFVEC2F end3DU ( aShape->GetEnd().x * m_biuTo3Dunits,
|
||||
-aShape->GetEnd().y * m_biuTo3Dunits );
|
||||
const SFVEC2F start3DU = TO_SFVEC2F( aShape->GetStart() );
|
||||
const SFVEC2F end3DU = TO_SFVEC2F( aShape->GetEnd() );
|
||||
const double linewidth3DU = TO_3DU( linewidth );
|
||||
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
{
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( start3DU, ( linewidth / 2 ) * m_biuTo3Dunits,
|
||||
*aShape ) );
|
||||
}
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( start3DU, linewidth3DU / 2, *aOwner ) );
|
||||
else
|
||||
{
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, linewidth * m_biuTo3Dunits,
|
||||
*aShape ) );
|
||||
}
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, linewidth3DU, *aOwner ) );
|
||||
}
|
||||
break;
|
||||
|
||||
@ -696,7 +628,7 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aDstCo
|
||||
if( polyList.IsEmpty() ) // Just for caution
|
||||
break;
|
||||
|
||||
ConvertPolygonToTriangles( polyList, *aDstContainer, m_biuTo3Dunits, *aShape );
|
||||
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aOwner );
|
||||
}
|
||||
break;
|
||||
|
||||
@ -708,24 +640,21 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aDstCo
|
||||
}
|
||||
|
||||
|
||||
// Based on
|
||||
// TransformSolidAreasShapesToPolygonSet
|
||||
// board_items_to_polygon_shape_transform.cpp
|
||||
void BOARD_ADAPTER::addSolidAreasShapes( const ZONE* aZoneContainer,
|
||||
CONTAINER_2D_BASE* aDstContainer, PCB_LAYER_ID aLayerId )
|
||||
void BOARD_ADAPTER::addSolidAreasShapes( const ZONE* aZone, CONTAINER_2D_BASE* aContainer,
|
||||
PCB_LAYER_ID aLayerId )
|
||||
{
|
||||
// Copy the polys list because we have to simplify it
|
||||
SHAPE_POLY_SET polyList = SHAPE_POLY_SET( aZoneContainer->GetFilledPolysList( aLayerId ) );
|
||||
SHAPE_POLY_SET polyList = SHAPE_POLY_SET( aZone->GetFilledPolysList( aLayerId ) );
|
||||
|
||||
// This convert the poly in outline and holes
|
||||
ConvertPolygonToTriangles( polyList, *aDstContainer, m_biuTo3Dunits, *aZoneContainer );
|
||||
ConvertPolygonToTriangles( polyList, *aContainer, m_biuTo3Dunits, *aZone );
|
||||
|
||||
// add filled areas outlines, which are drawn with thick lines segments
|
||||
// but only if filled polygons outlines have thickness
|
||||
if( !aZoneContainer->GetFilledPolysUseThickness() )
|
||||
if( !aZone->GetFilledPolysUseThickness() )
|
||||
return;
|
||||
|
||||
float line_thickness = aZoneContainer->GetMinThickness() * m_biuTo3Dunits;
|
||||
float width3DU = TO_3DU( aZone->GetMinThickness() );
|
||||
|
||||
for( int i = 0; i < polyList.OutlineCount(); ++i )
|
||||
{
|
||||
@ -734,23 +663,19 @@ void BOARD_ADAPTER::addSolidAreasShapes( const ZONE* aZoneContainer,
|
||||
|
||||
for( int j = 0; j < pathOutline.PointCount(); ++j )
|
||||
{
|
||||
const VECTOR2I& a = pathOutline.CPoint( j );
|
||||
const VECTOR2I& b = pathOutline.CPoint( j + 1 );
|
||||
|
||||
SFVEC2F start3DU( a.x * m_biuTo3Dunits, -a.y * m_biuTo3Dunits );
|
||||
SFVEC2F end3DU ( b.x * m_biuTo3Dunits, -b.y * m_biuTo3Dunits );
|
||||
SFVEC2F start3DU = TO_SFVEC2F( pathOutline.CPoint( j ) );
|
||||
SFVEC2F end3DU = TO_SFVEC2F( pathOutline.CPoint( j + 1 ) );
|
||||
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
{
|
||||
float radius = line_thickness/2;
|
||||
float radius3DU = width3DU / 2;
|
||||
|
||||
if( radius > 0.0 ) // degenerated circles crash 3D viewer
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( start3DU, radius, *aZoneContainer ) );
|
||||
if( radius3DU > 0.0 ) // degenerated circles crash 3D viewer
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( start3DU, radius3DU, *aZone ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, line_thickness,
|
||||
*aZoneContainer ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, width3DU, *aZone ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -761,24 +686,19 @@ void BOARD_ADAPTER::addSolidAreasShapes( const ZONE* aZoneContainer,
|
||||
|
||||
for( int j = 0; j < pathHole.PointCount(); j++ )
|
||||
{
|
||||
const VECTOR2I& a = pathHole.CPoint( j );
|
||||
const VECTOR2I& b = pathHole.CPoint( j + 1 );
|
||||
|
||||
SFVEC2F start3DU( a.x * m_biuTo3Dunits, -a.y * m_biuTo3Dunits );
|
||||
SFVEC2F end3DU ( b.x * m_biuTo3Dunits, -b.y * m_biuTo3Dunits );
|
||||
SFVEC2F start3DU = TO_SFVEC2F( pathHole.CPoint( j ) );
|
||||
SFVEC2F end3DU = TO_SFVEC2F( pathHole.CPoint( j + 1 ) );
|
||||
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
{
|
||||
float radius = line_thickness/2;
|
||||
float radius3DU = width3DU / 2;
|
||||
|
||||
if( radius > 0.0 ) // degenerated circles crash 3D viewer
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( start3DU, radius,
|
||||
*aZoneContainer ) );
|
||||
if( radius3DU > 0.0 ) // degenerated circles crash 3D viewer
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( start3DU, radius3DU, *aZone ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, line_thickness,
|
||||
*aZoneContainer ) );
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, width3DU, *aZone ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -786,19 +706,17 @@ void BOARD_ADAPTER::addSolidAreasShapes( const ZONE* aZoneContainer,
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::buildPadOutlineAsSegments( const PAD* aPad, CONTAINER_2D_BASE* aDstContainer,
|
||||
void BOARD_ADAPTER::buildPadOutlineAsSegments( const PAD* aPad, CONTAINER_2D_BASE* aContainer,
|
||||
int aWidth )
|
||||
{
|
||||
if( aPad->GetShape() == PAD_SHAPE::CIRCLE ) // Draw a ring
|
||||
{
|
||||
const SFVEC2F center3DU( aPad->ShapePos().x * m_biuTo3Dunits,
|
||||
-aPad->ShapePos().y * m_biuTo3Dunits );
|
||||
const SFVEC2F center3DU = TO_SFVEC2F( aPad->ShapePos() );
|
||||
const int radius = aPad->GetSize().x / 2;
|
||||
const float inner_radius3DU = TO_3DU( radius - aWidth / 2 );
|
||||
const float outer_radius3DU = TO_3DU( radius + aWidth / 2 );
|
||||
|
||||
const int radius = aPad->GetSize().x / 2;
|
||||
const float inner_radius = ( radius - aWidth / 2 ) * m_biuTo3Dunits;
|
||||
const float outer_radius = ( radius + aWidth / 2 ) * m_biuTo3Dunits;
|
||||
|
||||
aDstContainer->Add( new RING_2D( center3DU, inner_radius, outer_radius, *aPad ) );
|
||||
aContainer->Add( new RING_2D( center3DU, inner_radius3DU, outer_radius3DU, *aPad ) );
|
||||
|
||||
return;
|
||||
}
|
||||
@ -809,21 +727,12 @@ void BOARD_ADAPTER::buildPadOutlineAsSegments( const PAD* aPad, CONTAINER_2D_BAS
|
||||
|
||||
for( int j = 0; j < path.PointCount(); j++ )
|
||||
{
|
||||
const VECTOR2I& a = path.CPoint( j );
|
||||
const VECTOR2I& b = path.CPoint( j + 1 );
|
||||
|
||||
SFVEC2F start3DU( a.x * m_biuTo3Dunits, -a.y * m_biuTo3Dunits );
|
||||
SFVEC2F end3DU ( b.x * m_biuTo3Dunits, -b.y * m_biuTo3Dunits );
|
||||
SFVEC2F start3DU = TO_SFVEC2F( path.CPoint( j ) );
|
||||
SFVEC2F end3DU = TO_SFVEC2F( path.CPoint( j + 1 ) );
|
||||
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
{
|
||||
aDstContainer->Add( new FILLED_CIRCLE_2D( start3DU, ( aWidth / 2 ) * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
}
|
||||
aContainer->Add( new FILLED_CIRCLE_2D( start3DU, TO_3DU( aWidth / 2 ), *aPad ) );
|
||||
else
|
||||
{
|
||||
aDstContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, aWidth * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
}
|
||||
aContainer->Add( new ROUND_SEGMENT_2D( start3DU, end3DU, TO_3DU( aWidth ), *aPad ) );
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -37,6 +37,7 @@
|
||||
#include <footprint.h>
|
||||
#include <pad.h>
|
||||
#include <pcb_text.h>
|
||||
#include <pcb_textbox.h>
|
||||
#include <fp_shape.h>
|
||||
#include <zone.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
@ -606,11 +607,16 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_SHAPE_T:
|
||||
addShape( static_cast<PCB_SHAPE*>( item ), layerContainer );
|
||||
addShape( static_cast<PCB_SHAPE*>( item ), layerContainer, item );
|
||||
break;
|
||||
|
||||
case PCB_TEXT_T:
|
||||
addShape( static_cast<PCB_TEXT*>( item ), layerContainer );
|
||||
addText( static_cast<PCB_TEXT*>( item ), layerContainer, item );
|
||||
break;
|
||||
|
||||
case PCB_TEXTBOX_T:
|
||||
addText( static_cast<PCB_TEXTBOX*>( item ), layerContainer, item );
|
||||
addShape( static_cast<PCB_TEXTBOX*>( item ), layerContainer, item );
|
||||
break;
|
||||
|
||||
case PCB_DIM_ALIGNED_T:
|
||||
@ -618,7 +624,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
case PCB_DIM_RADIAL_T:
|
||||
case PCB_DIM_ORTHOGONAL_T:
|
||||
case PCB_DIM_LEADER_T:
|
||||
addShape( static_cast<PCB_DIMENSION_BASE*>( item ), layerContainer );
|
||||
addShape( static_cast<PCB_DIMENSION_BASE*>( item ), layerContainer, item );
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -657,8 +663,17 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
text->TransformTextShapeWithClearanceToPolygon( *layerPoly, cur_layer_id, 0,
|
||||
ARC_HIGH_DEF, ERROR_INSIDE );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PCB_TEXTBOX_T:
|
||||
{
|
||||
PCB_TEXTBOX* textbox = static_cast<PCB_TEXTBOX*>( item );
|
||||
|
||||
textbox->TransformTextShapeWithClearanceToPolygon( *layerPoly, cur_layer_id, 0,
|
||||
ARC_HIGH_DEF, ERROR_INSIDE );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
wxLogTrace( m_logTrace, wxT( "createLayers: item type: %d not implemented" ),
|
||||
@ -911,11 +926,16 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_SHAPE_T:
|
||||
addShape( static_cast<PCB_SHAPE*>( item ), layerContainer );
|
||||
addShape( static_cast<PCB_SHAPE*>( item ), layerContainer, item );
|
||||
break;
|
||||
|
||||
case PCB_TEXT_T:
|
||||
addShape( static_cast<PCB_TEXT*>( item ), layerContainer );
|
||||
addText( static_cast<PCB_TEXT*>( item ), layerContainer, item );
|
||||
break;
|
||||
|
||||
case PCB_TEXTBOX_T:
|
||||
addText( static_cast<PCB_TEXTBOX*>( item ), layerContainer, item );
|
||||
addShape( static_cast<PCB_TEXTBOX*>( item ), layerContainer, item );
|
||||
break;
|
||||
|
||||
case PCB_DIM_ALIGNED_T:
|
||||
@ -923,7 +943,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
case PCB_DIM_RADIAL_T:
|
||||
case PCB_DIM_ORTHOGONAL_T:
|
||||
case PCB_DIM_LEADER_T:
|
||||
addShape( static_cast<PCB_DIMENSION_BASE*>( item ), layerContainer );
|
||||
addShape( static_cast<PCB_DIMENSION_BASE*>( item ), layerContainer, item );
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -950,8 +970,17 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
text->TransformTextShapeWithClearanceToPolygon( *layerPoly, curr_layer_id, 0,
|
||||
ARC_HIGH_DEF, ERROR_INSIDE );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case PCB_TEXTBOX_T:
|
||||
{
|
||||
PCB_TEXTBOX* textbox = static_cast<PCB_TEXTBOX*>( item );
|
||||
|
||||
textbox->TransformTextShapeWithClearanceToPolygon( *layerPoly, curr_layer_id, 0,
|
||||
ARC_HIGH_DEF, ERROR_INSIDE );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -22,19 +22,14 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file object_2d.cpp
|
||||
*/
|
||||
|
||||
#include "object_2d.h"
|
||||
#include <wx/log.h>
|
||||
#include <map>
|
||||
|
||||
OBJECT_2D_STATS *OBJECT_2D_STATS::s_instance = nullptr;
|
||||
|
||||
|
||||
OBJECT_2D::OBJECT_2D( OBJECT_2D_TYPE aObjType, const BOARD_ITEM& aBoardItem )
|
||||
: m_boardItem(aBoardItem)
|
||||
OBJECT_2D::OBJECT_2D( OBJECT_2D_TYPE aObjType, const BOARD_ITEM& aBoardItem ) :
|
||||
m_boardItem( aBoardItem )
|
||||
{
|
||||
m_obj_type = aObjType;
|
||||
OBJECT_2D_STATS::Instance().AddOne( aObjType );
|
||||
|
@ -545,8 +545,10 @@ set( PCB_COMMON_SRCS
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pad.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_target.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_text.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_textbox.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/board_stackup_manager/board_stackup.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/fp_text.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/fp_textbox.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_track.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/zone.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/collectors.cpp
|
||||
|
@ -316,7 +316,9 @@ static struct EDA_ITEM_DESC
|
||||
.Map( PCB_PAD_T, _HKI( "Pad" ) )
|
||||
.Map( PCB_SHAPE_T, _HKI( "Graphic" ) )
|
||||
.Map( PCB_TEXT_T, _HKI( "Text" ) )
|
||||
.Map( PCB_TEXTBOX_T, _HKI( "Text Box" ) )
|
||||
.Map( PCB_FP_TEXT_T, _HKI( "Text" ) )
|
||||
.Map( PCB_FP_TEXTBOX_T, _HKI( "Text Box" ) )
|
||||
.Map( PCB_FP_SHAPE_T, _HKI( "Graphic" ) )
|
||||
.Map( PCB_FP_DIM_ALIGNED_T, _HKI( "Dimension" ) )
|
||||
.Map( PCB_FP_DIM_ORTHOGONAL_T, _HKI( "Dimension" ) )
|
||||
|
@ -246,7 +246,7 @@ void EDA_SHAPE::rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
|
||||
break;
|
||||
}
|
||||
|
||||
// Convert non-cartesian-rotated rect to a diamond
|
||||
// Convert non-cardinally-rotated rect to a diamond
|
||||
m_shape = SHAPE_T::POLY;
|
||||
m_poly.RemoveAllContours();
|
||||
m_poly.NewOutline();
|
||||
|
@ -457,8 +457,11 @@ EDA_TEXT::GetRenderCache( const wxString& forResolvedText ) const
|
||||
m_render_cache.clear();
|
||||
|
||||
KIFONT::OUTLINE_FONT* font = static_cast<KIFONT::OUTLINE_FONT*>( GetFont() );
|
||||
font->GetLinesAsGlyphs( &m_render_cache, this );
|
||||
TEXT_ATTRIBUTES attrs = GetAttributes();
|
||||
|
||||
attrs.m_Angle = resolvedAngle;
|
||||
|
||||
font->GetLinesAsGlyphs( &m_render_cache, GetShownText(), GetDrawPos(), attrs );
|
||||
m_render_cache_angle = resolvedAngle;
|
||||
m_render_cache_text = forResolvedText;
|
||||
}
|
||||
@ -507,8 +510,14 @@ int EDA_TEXT::GetInterline() const
|
||||
|
||||
EDA_RECT EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
|
||||
{
|
||||
VECTOR2I drawPos = GetDrawPos();
|
||||
|
||||
if( m_bounding_box_cache_valid && aLine < 0 && !aInvertY )
|
||||
{
|
||||
m_bounding_box_cache.Offset( drawPos - m_bounding_box_cache_pos );
|
||||
m_bounding_box_cache_pos = drawPos;
|
||||
return m_bounding_box_cache;
|
||||
}
|
||||
|
||||
EDA_RECT rect;
|
||||
wxArrayString strings;
|
||||
@ -540,7 +549,7 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
|
||||
// Creates bounding box (rectangle) for horizontal, left and top justified text. The
|
||||
// bounding box will be moved later according to the actual text options
|
||||
wxSize textsize = wxSize( dx, fontSize.y );
|
||||
VECTOR2I pos = GetTextPos();
|
||||
VECTOR2I pos = drawPos;
|
||||
|
||||
if( IsMultilineAllowed() && aLine > 0 && ( aLine < static_cast<int>( strings.GetCount() ) ) )
|
||||
pos.y -= aLine * GetInterline();
|
||||
@ -599,6 +608,7 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
|
||||
if( aLine < 0 && !aInvertY )
|
||||
{
|
||||
m_bounding_box_cache_valid = true;
|
||||
m_bounding_box_cache_pos = drawPos;
|
||||
m_bounding_box_cache = rect;
|
||||
}
|
||||
|
||||
@ -612,7 +622,7 @@ bool EDA_TEXT::TextHitTest( const VECTOR2I& aPoint, int aAccuracy ) const
|
||||
VECTOR2I location = aPoint;
|
||||
|
||||
rect.Inflate( aAccuracy );
|
||||
RotatePoint( location, GetTextPos(), -GetTextAngle() );
|
||||
RotatePoint( location, GetDrawPos(), -GetDrawRotation() );
|
||||
|
||||
return rect.Contains( location );
|
||||
}
|
||||
@ -627,7 +637,7 @@ bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy
|
||||
if( aContains )
|
||||
return rect.Contains( GetTextBox() );
|
||||
|
||||
return rect.Intersects( GetTextBox(), GetTextAngle() );
|
||||
return rect.Intersects( GetTextBox(), GetDrawRotation() );
|
||||
}
|
||||
|
||||
|
||||
@ -649,14 +659,14 @@ void EDA_TEXT::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
|
||||
}
|
||||
else
|
||||
{
|
||||
printOneLineOfText( aSettings, aOffset, aColor, aFillMode, GetShownText(), GetTextPos() );
|
||||
printOneLineOfText( aSettings, aOffset, aColor, aFillMode, GetShownText(), GetDrawPos() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EDA_TEXT::GetLinePositions( std::vector<VECTOR2I>& aPositions, int aLineCount ) const
|
||||
{
|
||||
VECTOR2I pos = GetTextPos(); // Position of first line of the multiline text according
|
||||
VECTOR2I pos = GetDrawPos(); // Position of first line of the multiline text according
|
||||
// to the center of the multiline text block
|
||||
|
||||
VECTOR2I offset; // Offset to next line.
|
||||
@ -681,10 +691,10 @@ void EDA_TEXT::GetLinePositions( std::vector<VECTOR2I>& aPositions, int aLineCou
|
||||
}
|
||||
|
||||
// Rotate the position of the first line around the center of the multiline text block
|
||||
RotatePoint( pos, GetTextPos(), GetTextAngle() );
|
||||
RotatePoint( pos, GetDrawPos(), GetDrawRotation() );
|
||||
|
||||
// Rotate the offset lines to increase happened in the right direction
|
||||
RotatePoint( offset, GetTextAngle() );
|
||||
RotatePoint( offset, GetDrawRotation() );
|
||||
|
||||
for( int ii = 0; ii < aLineCount; ii++ )
|
||||
{
|
||||
@ -709,7 +719,7 @@ void EDA_TEXT::printOneLineOfText( const RENDER_SETTINGS* aSettings, const VECTO
|
||||
if( IsMirrored() )
|
||||
size.x = -size.x;
|
||||
|
||||
GRPrintText( DC, aOffset + aPos, aColor, aText, GetTextAngle(), size, GetHorizJustify(),
|
||||
GRPrintText( DC, aOffset + aPos, aColor, aText, GetDrawRotation(), size, GetHorizJustify(),
|
||||
GetVertJustify(), penWidth, IsItalic(), IsBold(), GetDrawFont() );
|
||||
}
|
||||
|
||||
@ -850,7 +860,7 @@ std::shared_ptr<SHAPE_COMPOUND> EDA_TEXT::GetEffectiveTextShape( ) const
|
||||
TEXT_ATTRIBUTES attrs = GetAttributes();
|
||||
attrs.m_Angle = GetDrawRotation();
|
||||
|
||||
font->Draw( &callback_gal, GetShownText(), GetTextPos(), attrs );
|
||||
font->Draw( &callback_gal, GetShownText(), GetDrawPos(), attrs );
|
||||
|
||||
return shape;
|
||||
}
|
||||
@ -930,7 +940,7 @@ void EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon( SHAPE_POLY_SET* aCorn
|
||||
for( VECTOR2I& corner : corners )
|
||||
{
|
||||
// Rotate polygon
|
||||
RotatePoint( corner, GetTextPos(), GetTextAngle() );
|
||||
RotatePoint( corner, GetDrawPos(), GetDrawRotation() );
|
||||
aCornerBuffer->Append( corner.x, corner.y );
|
||||
}
|
||||
}
|
||||
|
@ -447,7 +447,8 @@ void FONT::LinebreakText( wxString& aText, int aColumnWidth, const VECTOR2I& aSi
|
||||
|
||||
for( size_t jj = 0; jj < words.size(); /* advance in loop */ )
|
||||
{
|
||||
if( lineWidth + spaceWidth + words[jj].second < aColumnWidth - aThickness )
|
||||
if( lineWidth == 0
|
||||
|| lineWidth + spaceWidth + words[jj].second < aColumnWidth - aThickness )
|
||||
{
|
||||
if( lineWidth > 0 )
|
||||
{
|
||||
|
@ -191,20 +191,6 @@ BOX2I OUTLINE_FONT::getBoundingBox( const std::vector<std::unique_ptr<GLYPH>>& a
|
||||
}
|
||||
|
||||
|
||||
void OUTLINE_FONT::GetLinesAsGlyphs( std::vector<std::unique_ptr<GLYPH>>* aGlyphs,
|
||||
const EDA_TEXT* aText ) const
|
||||
{
|
||||
wxArrayString strings;
|
||||
std::vector<VECTOR2I> positions;
|
||||
std::vector<VECTOR2I> extents;
|
||||
TEXT_ATTRIBUTES attrs = aText->GetAttributes();
|
||||
|
||||
attrs.m_Angle = aText->GetDrawRotation();
|
||||
|
||||
return GetLinesAsGlyphs( aGlyphs, aText->GetShownText(), aText->GetTextPos(), attrs );
|
||||
}
|
||||
|
||||
|
||||
void OUTLINE_FONT::GetLinesAsGlyphs( std::vector<std::unique_ptr<GLYPH>>* aGlyphs,
|
||||
const wxString& aText, const VECTOR2I& aPosition,
|
||||
const TEXT_ATTRIBUTES& aAttrs ) const
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include <footprint.h>
|
||||
#include <fp_text.h>
|
||||
#include <fp_textbox.h>
|
||||
#include <fp_shape.h>
|
||||
#include <pad.h>
|
||||
|
||||
@ -115,7 +116,7 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags )
|
||||
|
||||
ret = hash_board_item( text, aFlags );
|
||||
hash_combine( ret, text->GetText().ToStdString() );
|
||||
hash_combine( ret, text->IsItalic() );
|
||||
hash_combine( ret, text->IsItalic() );
|
||||
hash_combine( ret, text->IsBold() );
|
||||
hash_combine( ret, text->IsMirrored() );
|
||||
hash_combine( ret, text->GetTextWidth() );
|
||||
@ -179,6 +180,46 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags )
|
||||
}
|
||||
break;
|
||||
|
||||
case PCB_FP_TEXTBOX_T:
|
||||
{
|
||||
const FP_TEXTBOX* textbox = static_cast<const FP_TEXTBOX*>( aItem );
|
||||
|
||||
ret = hash_board_item( textbox, aFlags );
|
||||
hash_combine( ret, textbox->GetText().ToStdString() );
|
||||
hash_combine( ret, textbox->IsItalic() );
|
||||
hash_combine( ret, textbox->IsBold() );
|
||||
hash_combine( ret, textbox->IsMirrored() );
|
||||
hash_combine( ret, textbox->GetTextWidth() );
|
||||
hash_combine( ret, textbox->GetTextHeight() );
|
||||
hash_combine( ret, textbox->GetHorizJustify() );
|
||||
hash_combine( ret, textbox->GetVertJustify() );
|
||||
|
||||
if( aFlags & HASH_ROT )
|
||||
hash_combine( ret, textbox->GetTextAngle().AsDegrees() );
|
||||
|
||||
hash_combine( ret, textbox->GetShape() );
|
||||
hash_combine( ret, textbox->GetWidth() );
|
||||
|
||||
if( aFlags & HASH_POS )
|
||||
{
|
||||
if( aFlags & REL_COORD )
|
||||
{
|
||||
hash_combine( ret, textbox->GetStart0().x );
|
||||
hash_combine( ret, textbox->GetStart0().y );
|
||||
hash_combine( ret, textbox->GetEnd0().x );
|
||||
hash_combine( ret, textbox->GetEnd0().y );
|
||||
}
|
||||
else
|
||||
{
|
||||
hash_combine( ret, textbox->GetStart().x );
|
||||
hash_combine( ret, textbox->GetStart().y );
|
||||
hash_combine( ret, textbox->GetEnd().x );
|
||||
hash_combine( ret, textbox->GetEnd().y );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
wxASSERT_MSG( false, "Unhandled type in function hash_fp_item() (exporter_gencad.cpp)" );
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
# This program source code file is part of KiCad, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2012 CERN.
|
||||
# Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
# Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@ -120,6 +120,7 @@ fp_line
|
||||
fp_poly
|
||||
fp_rect
|
||||
fp_text
|
||||
fp_text_box
|
||||
free
|
||||
full
|
||||
general
|
||||
@ -133,6 +134,7 @@ gr_line
|
||||
gr_poly
|
||||
gr_rect
|
||||
gr_text
|
||||
gr_text_box
|
||||
hatch
|
||||
hatch_thickness
|
||||
hatch_gap
|
||||
|
@ -96,7 +96,7 @@ DIALOG_FIELD_PROPERTIES_BASE::DIALOG_FIELD_PROPERTIES_BASE( wxWindow* parent, wx
|
||||
|
||||
m_fontLabel = new wxStaticText( this, wxID_ANY, _("Font:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fontLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_fontLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
|
||||
gbSizer1->Add( m_fontLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_fontCtrlChoices[] = { _("Default Font"), _("KiCad Font") };
|
||||
int m_fontCtrlNChoices = sizeof( m_fontCtrlChoices ) / sizeof( wxString );
|
||||
|
@ -512,7 +512,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT</property>
|
||||
<property name="row">0</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
|
@ -65,7 +65,7 @@ DIALOG_LIB_TEXT_PROPERTIES_BASE::DIALOG_LIB_TEXT_PROPERTIES_BASE( wxWindow* pare
|
||||
|
||||
m_fontLabel = new wxStaticText( this, wxID_ANY, _("Font:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fontLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_fontLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
|
||||
gbSizer1->Add( m_fontLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_fontCtrlChoices[] = { _("Default Font"), _("KiCad Font") };
|
||||
int m_fontCtrlNChoices = sizeof( m_fontCtrlChoices ) / sizeof( wxString );
|
||||
|
@ -222,7 +222,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT</property>
|
||||
<property name="row">2</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
@ -356,7 +356,7 @@
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="row">2</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">formattingSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
|
@ -63,13 +63,13 @@ DIALOG_LIB_TEXTBOX_PROPERTIES_BASE::DIALOG_LIB_TEXTBOX_PROPERTIES_BASE( wxWindow
|
||||
|
||||
m_fontLabel = new wxStaticText( this, wxID_ANY, _("Font:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_fontLabel->Wrap( -1 );
|
||||
m_textEntrySizer->Add( m_fontLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
m_textEntrySizer->Add( m_fontLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
|
||||
|
||||
wxString m_fontCtrlChoices[] = { _("Default Font"), _("KiCad Font") };
|
||||
int m_fontCtrlNChoices = sizeof( m_fontCtrlChoices ) / sizeof( wxString );
|
||||
m_fontCtrl = new FONT_CHOICE( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_fontCtrlNChoices, m_fontCtrlChoices, 0 );
|
||||
m_fontCtrl->SetSelection( 0 );
|
||||
m_textEntrySizer->Add( m_fontCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
m_textEntrySizer->Add( m_fontCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP, 5 );
|
||||
|
||||
wxBoxSizer* bSizeCtrlSizer;
|
||||
bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
@ -77,50 +77,50 @@ DIALOG_LIB_TEXTBOX_PROPERTIES_BASE::DIALOG_LIB_TEXTBOX_PROPERTIES_BASE( wxWindow
|
||||
m_separator1 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
|
||||
m_separator1->Enable( false );
|
||||
|
||||
bSizeCtrlSizer->Add( m_separator1, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
bSizeCtrlSizer->Add( m_separator1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
|
||||
|
||||
m_bold = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
|
||||
m_bold->SetToolTip( _("Bold") );
|
||||
|
||||
bSizeCtrlSizer->Add( m_bold, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bSizeCtrlSizer->Add( m_bold, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_italic = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
|
||||
m_italic->SetToolTip( _("Italic") );
|
||||
|
||||
bSizeCtrlSizer->Add( m_italic, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bSizeCtrlSizer->Add( m_italic, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_separator2 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
|
||||
m_separator2->Enable( false );
|
||||
|
||||
bSizeCtrlSizer->Add( m_separator2, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bSizeCtrlSizer->Add( m_separator2, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_spin0 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
|
||||
m_spin0->SetToolTip( _("Align right") );
|
||||
|
||||
bSizeCtrlSizer->Add( m_spin0, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bSizeCtrlSizer->Add( m_spin0, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_spin1 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
|
||||
m_spin1->SetToolTip( _("Align bottom") );
|
||||
|
||||
bSizeCtrlSizer->Add( m_spin1, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bSizeCtrlSizer->Add( m_spin1, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_spin2 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
|
||||
m_spin2->SetToolTip( _("Align left") );
|
||||
|
||||
bSizeCtrlSizer->Add( m_spin2, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bSizeCtrlSizer->Add( m_spin2, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_spin3 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
|
||||
m_spin3->SetToolTip( _("Align top") );
|
||||
|
||||
bSizeCtrlSizer->Add( m_spin3, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
bSizeCtrlSizer->Add( m_spin3, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_separator3 = new BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE );
|
||||
m_separator3->Enable( false );
|
||||
|
||||
bSizeCtrlSizer->Add( m_separator3, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
|
||||
bSizeCtrlSizer->Add( m_separator3, 0, wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
m_textEntrySizer->Add( bSizeCtrlSizer, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 );
|
||||
m_textEntrySizer->Add( bSizeCtrlSizer, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 );
|
||||
|
||||
wxBoxSizer* bSizer41;
|
||||
bSizer41 = new wxBoxSizer( wxVERTICAL );
|
||||
|
@ -211,7 +211,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
@ -275,7 +275,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">2</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxChoice" expanded="1">
|
||||
@ -342,17 +342,17 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">3</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizeCtrlSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -424,7 +424,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -496,7 +496,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -568,7 +568,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -640,7 +640,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -712,7 +712,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -784,7 +784,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -856,7 +856,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@ -928,7 +928,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -120,20 +120,20 @@ void LIB_TEXTBOX::UpdateTextPosition()
|
||||
BOX2I bbox( VECTOR2I( std::min( m_start.x, m_end.x ), std::min( -m_start.y, -m_end.y ) ),
|
||||
VECTOR2I( abs( m_end.x - m_start.x ), abs( m_end.y - m_start.y ) ) );
|
||||
|
||||
if( GetTextAngle() == ANGLE_HORIZONTAL )
|
||||
{
|
||||
if( GetHorizJustify() == GR_TEXT_H_ALIGN_RIGHT )
|
||||
SetTextPos( VECTOR2I( bbox.GetRight() - margin, bbox.GetTop() + margin ) );
|
||||
else
|
||||
SetTextPos( VECTOR2I( bbox.GetLeft() + margin, bbox.GetTop() + margin ) );
|
||||
}
|
||||
else
|
||||
if( GetTextAngle() == ANGLE_VERTICAL )
|
||||
{
|
||||
if( GetHorizJustify() == GR_TEXT_H_ALIGN_RIGHT )
|
||||
SetTextPos( VECTOR2I( bbox.GetLeft() + margin, bbox.GetTop() + margin ) );
|
||||
else
|
||||
SetTextPos( VECTOR2I( bbox.GetLeft() + margin, bbox.GetBottom() - margin ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( GetHorizJustify() == GR_TEXT_H_ALIGN_RIGHT )
|
||||
SetTextPos( VECTOR2I( bbox.GetRight() - margin, bbox.GetTop() + margin ) );
|
||||
else
|
||||
SetTextPos( VECTOR2I( bbox.GetLeft() + margin, bbox.GetTop() + margin ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -374,8 +374,6 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, const VECTOR2I& aOffset, bool aFill,
|
||||
|
||||
void LIB_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
// Don't use GetShownText() here; we want to show the user the variable references
|
||||
aList.emplace_back( _( "Text Box" ), UnescapeString( GetText() ) );
|
||||
|
||||
|
@ -404,24 +404,6 @@ EDA_ANGLE SCH_FIELD::GetDrawRotation() const
|
||||
}
|
||||
|
||||
|
||||
VECTOR2I SCH_FIELD::GetDrawPos() const
|
||||
{
|
||||
return GetBoundingBox().Centre();
|
||||
}
|
||||
|
||||
|
||||
GR_TEXT_H_ALIGN_T SCH_FIELD::GetDrawHorizJustify() const
|
||||
{
|
||||
return GR_TEXT_H_ALIGN_CENTER;
|
||||
}
|
||||
|
||||
|
||||
GR_TEXT_V_ALIGN_T SCH_FIELD::GetDrawVertJustify() const
|
||||
{
|
||||
return GR_TEXT_V_ALIGN_CENTER;
|
||||
}
|
||||
|
||||
|
||||
const EDA_RECT SCH_FIELD::GetBoundingBox() const
|
||||
{
|
||||
// Calculate the text bounding box:
|
||||
|
@ -122,9 +122,6 @@ public:
|
||||
* Adjusters to allow EDA_TEXT to draw/print/etc. text in absolute coords.
|
||||
*/
|
||||
EDA_ANGLE GetDrawRotation() const override;
|
||||
VECTOR2I GetDrawPos() const override;
|
||||
GR_TEXT_H_ALIGN_T GetDrawHorizJustify() const override;
|
||||
GR_TEXT_V_ALIGN_T GetDrawVertJustify() const override;
|
||||
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
|
@ -114,20 +114,20 @@ void SCH_TEXTBOX::UpdateTextPosition()
|
||||
|
||||
bbox.Normalize();
|
||||
|
||||
if( GetTextAngle() == ANGLE_HORIZONTAL )
|
||||
{
|
||||
if( GetHorizJustify() == GR_TEXT_H_ALIGN_RIGHT )
|
||||
SetTextPos( VECTOR2I( bbox.GetRight() - margin, bbox.GetTop() + margin ) );
|
||||
else
|
||||
SetTextPos( VECTOR2I( bbox.GetLeft() + margin, bbox.GetTop() + margin ) );
|
||||
}
|
||||
else
|
||||
if( GetTextAngle() == ANGLE_VERTICAL )
|
||||
{
|
||||
if( GetHorizJustify() == GR_TEXT_H_ALIGN_RIGHT )
|
||||
SetTextPos( VECTOR2I( bbox.GetLeft() + margin, bbox.GetTop() + margin ) );
|
||||
else
|
||||
SetTextPos( VECTOR2I( bbox.GetLeft() + margin, bbox.GetBottom() - margin ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( GetHorizJustify() == GR_TEXT_H_ALIGN_RIGHT )
|
||||
SetTextPos( VECTOR2I( bbox.GetRight() - margin, bbox.GetTop() + margin ) );
|
||||
else
|
||||
SetTextPos( VECTOR2I( bbox.GetLeft() + margin, bbox.GetTop() + margin ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -360,8 +360,6 @@ void SCH_TEXTBOX::Plot( PLOTTER* aPlotter ) const
|
||||
|
||||
void SCH_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
// Don't use GetShownText() here; we want to show the user the variable references
|
||||
aList.emplace_back( _( "Text Box" ), UnescapeString( GetText() ) );
|
||||
|
||||
|
@ -89,7 +89,9 @@ enum KICAD_T
|
||||
PCB_PAD_T, ///< class PAD, a pad in a footprint
|
||||
PCB_SHAPE_T, ///< class PCB_SHAPE, a segment not on copper layers
|
||||
PCB_TEXT_T, ///< class PCB_TEXT, text on a layer
|
||||
PCB_TEXTBOX_T, ///< class PCB_TEXTBOX, wrapped text on a layer
|
||||
PCB_FP_TEXT_T, ///< class FP_TEXT, text in a footprint
|
||||
PCB_FP_TEXTBOX_T, ///< class FP_TEXTBOX, wrapped text in a footprint
|
||||
PCB_FP_SHAPE_T, ///< class FP_SHAPE, a footprint edge
|
||||
PCB_FP_DIM_ALIGNED_T, ///< class PCB_DIM_ALIGNED, a linear dimension (graphic item)
|
||||
PCB_FP_DIM_LEADER_T, ///< class PCB_DIM_LEADER, a leader dimension (graphic item)
|
||||
@ -405,7 +407,9 @@ constexpr bool IsPcbnewType( const KICAD_T aType )
|
||||
case PCB_PAD_T:
|
||||
case PCB_SHAPE_T:
|
||||
case PCB_TEXT_T:
|
||||
case PCB_TEXTBOX_T:
|
||||
case PCB_FP_TEXT_T:
|
||||
case PCB_FP_TEXTBOX_T:
|
||||
case PCB_FP_SHAPE_T:
|
||||
case PCB_FP_DIM_ALIGNED_T:
|
||||
case PCB_FP_DIM_LEADER_T:
|
||||
|
@ -304,8 +304,6 @@ public:
|
||||
virtual KIFONT::FONT* GetDrawFont() const;
|
||||
virtual EDA_ANGLE GetDrawRotation() const { return GetTextAngle(); }
|
||||
virtual VECTOR2I GetDrawPos() const { return GetTextPos(); }
|
||||
virtual GR_TEXT_H_ALIGN_T GetDrawHorizJustify() const { return GetHorizJustify(); };
|
||||
virtual GR_TEXT_V_ALIGN_T GetDrawVertJustify() const { return GetVertJustify(); };
|
||||
|
||||
virtual void ClearRenderCache();
|
||||
virtual void ClearBoundingBoxCache();
|
||||
@ -344,6 +342,7 @@ private:
|
||||
mutable std::vector<std::unique_ptr<KIFONT::GLYPH>> m_render_cache;
|
||||
|
||||
mutable bool m_bounding_box_cache_valid;
|
||||
mutable VECTOR2I m_bounding_box_cache_pos;
|
||||
mutable EDA_RECT m_bounding_box_cache;
|
||||
|
||||
TEXT_ATTRIBUTES m_attributes;
|
||||
|
@ -112,9 +112,6 @@ public:
|
||||
* @param aGlyphs returns text glyphs
|
||||
* @param aText the text item
|
||||
*/
|
||||
void GetLinesAsGlyphs( std::vector<std::unique_ptr<GLYPH>>* aGlyphs,
|
||||
const EDA_TEXT* aText ) const;
|
||||
|
||||
void GetLinesAsGlyphs( std::vector<std::unique_ptr<GLYPH>>* aGlyphs, const wxString& aText,
|
||||
const VECTOR2I& aPosition, const TEXT_ATTRIBUTES& aAttrs ) const;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user