KiCad PCB EDA Suite
lib_pin.cpp File Reference
#include <pgm_base.h>
#include <sch_draw_panel.h>
#include <sch_edit_frame.h>
#include <symbol_edit_frame.h>
#include <lib_pin.h>
#include <settings/settings_manager.h>
#include <symbol_editor/symbol_editor_settings.h>
#include <trigo.h>
#include "sch_painter.h"

Go to the source code of this file.

Macros

#define PIN_TEXT_MARGIN   4
 
#define ETXT_MAX_SIZE   Millimeter2iu( 0.7 )
 

Functions

static int internalPinDecoSize (const RENDER_SETTINGS *aSettings, const LIB_PIN &aPin)
 Utility for getting the size of the 'internal' pin decorators (as a radius) More...
 
static int externalPinDecoSize (const RENDER_SETTINGS *aSettings, const LIB_PIN &aPin)
 Utility for getting the size of the 'external' pin decorators (as a radius) More...
 

Macro Definition Documentation

◆ ETXT_MAX_SIZE

#define ETXT_MAX_SIZE   Millimeter2iu( 0.7 )

◆ PIN_TEXT_MARGIN

#define PIN_TEXT_MARGIN   4

Definition at line 37 of file lib_pin.cpp.

Function Documentation

◆ externalPinDecoSize()

static int externalPinDecoSize ( const RENDER_SETTINGS aSettings,
const LIB_PIN aPin 
)
static

Utility for getting the size of the 'external' pin decorators (as a radius)

Definition at line 82 of file lib_pin.cpp.

83 {
84  const KIGFX::SCH_RENDER_SETTINGS* settings = static_cast<const KIGFX::SCH_RENDER_SETTINGS*>( aSettings );
85 
86  if( settings && settings->m_PinSymbolSize )
87  return settings->m_PinSymbolSize;
88 
89  return aPin.GetNumberTextSize() / 2;
90 }
int GetNumberTextSize() const
Definition: lib_pin.h:177
SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:72

References LIB_PIN::GetNumberTextSize(), and KIGFX::SCH_RENDER_SETTINGS::m_PinSymbolSize.

Referenced by LIB_PIN::GetBoundingBox(), LIB_PIN::PlotSymbol(), and LIB_PIN::printPinSymbol().

◆ internalPinDecoSize()

static int internalPinDecoSize ( const RENDER_SETTINGS aSettings,
const LIB_PIN aPin 
)
static

Utility for getting the size of the 'internal' pin decorators (as a radius)

Definition at line 69 of file lib_pin.cpp.

70 {
71  const KIGFX::SCH_RENDER_SETTINGS* settings = static_cast<const KIGFX::SCH_RENDER_SETTINGS*>( aSettings );
72 
73  if( settings && settings->m_PinSymbolSize )
74  return settings->m_PinSymbolSize;
75 
76  return aPin.GetNameTextSize() != 0 ? aPin.GetNameTextSize() / 2 : aPin.GetNumberTextSize() / 2;
77 }
int GetNameTextSize() const
Definition: lib_pin.h:174
int GetNumberTextSize() const
Definition: lib_pin.h:177
SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:72

References LIB_PIN::GetNameTextSize(), LIB_PIN::GetNumberTextSize(), and KIGFX::SCH_RENDER_SETTINGS::m_PinSymbolSize.

Referenced by LIB_PIN::PlotSymbol(), and LIB_PIN::printPinSymbol().