7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 17:23:44 +00:00

Retire non-cairo printing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19323
This commit is contained in:
Jeff Young 2025-02-03 15:15:15 +00:00
parent f9c41d70d1
commit f2da0c791f
61 changed files with 326 additions and 2302 deletions

View File

@ -103,8 +103,6 @@ static const wxChar EnableGenerators[] = wxT( "EnableGenerators" );
static const wxChar EnableGit[] = wxT( "EnableGit" );
static const wxChar EnableLibWithText[] = wxT( "EnableLibWithText" );
static const wxChar EnableLibDir[] = wxT( "EnableLibDir" );
static const wxChar EnableEeschemaPrintCairo[] = wxT( "EnableEeschemaPrintCairo" );
static const wxChar EnableEeschemaExportClipboardCairo[] = wxT( "EnableEeschemaExportClipboardCairo" );
static const wxChar DisambiguationTime[] = wxT( "DisambiguationTime" );
static const wxChar PcbSelectionVisibilityRatio[] = wxT( "PcbSelectionVisibilityRatio" );
static const wxChar FontErrorSize[] = wxT( "FontErrorSize" );
@ -262,9 +260,6 @@ ADVANCED_CFG::ADVANCED_CFG()
m_EnableLibWithText = false;
m_EnableLibDir = false;
m_EnableEeschemaPrintCairo = true;
m_EnableEeschemaExportClipboardCairo = true;
m_3DRT_BevelHeight_um = 30;
m_3DRT_BevelExtentFactor = 1.0 / 16.0;
@ -508,14 +503,6 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableLibDir,
&m_EnableLibDir, m_EnableLibDir ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableEeschemaPrintCairo,
&m_EnableEeschemaPrintCairo,
m_EnableEeschemaPrintCairo ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableEeschemaExportClipboardCairo,
&m_EnableEeschemaExportClipboardCairo,
m_EnableEeschemaExportClipboardCairo ) );
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::PcbSelectionVisibilityRatio,
&m_PcbSelectionVisibilityRatio,
m_PcbSelectionVisibilityRatio, 0.0, 1.0 ) );

View File

@ -438,12 +438,6 @@ void EDA_DRAW_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent )
}
void EDA_DRAW_FRAME::PrintPage( const RENDER_SETTINGS* aSettings )
{
DisplayErrorMessage( this, wxT( "EDA_DRAW_FRAME::PrintPage() error" ) );
}
void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
{
wxCHECK_RET( m_gridSelectBox, wxS( "m_gridSelectBox uninitialized" ) );

View File

@ -34,7 +34,6 @@
#include "marker_base.h"
#include <core/arraydim.h>
#include <geometry/shape_line_chain.h>
#include <render_settings.h>
#include "dialogs/dialog_display_html_text_base.h"
@ -85,11 +84,6 @@ MARKER_BASE::MARKER_BASE( int aScalingFactor, std::shared_ptr<RC_ITEM> aItem, MA
}
MARKER_BASE::~MARKER_BASE()
{
}
bool MARKER_BASE::HitTestMarker( const VECTOR2I& aHitPosition, int aAccuracy ) const
{
const BOX2I bbox = GetBoundingBoxMarker().GetInflated( aAccuracy );
@ -144,16 +138,3 @@ BOX2I MARKER_BASE::GetBoundingBoxMarker() const
}
void MARKER_BASE::PrintMarker( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
{
wxDC* DC = aSettings->GetPrintDC();
// Build the marker shape polygon in internal units:
std::vector<VECTOR2I> shape;
shape.reserve( CORNERS_COUNT );
for( const VECTOR2I& corner : MarkerShapeCorners )
shape.emplace_back( corner * MarkerScale() + m_Pos + aOffset );
GRClosedPoly( DC, CORNERS_COUNT, &shape[0], true, getColor() );
}

View File

@ -35,6 +35,7 @@
#include <widgets/grid_icon_text_helpers.h>
#include <widgets/std_bitmap_button.h>
#include <wx/hyperlink.h>
#include <symbol_preview_widget.h>
class ALT_PIN_DATA_MODEL : public wxGridTableBase, public std::vector<SCH_PIN::ALT>
{
@ -137,22 +138,41 @@ DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES( SYMBOL_EDIT_FRAME* parent, SCH_PIN
m_delayedFocusColumn( -1 ),
m_initialized( false )
{
// Creates a dummy pin to show on a panel, inside this dialog:
// Create a dummy symbol with a single pin for the preview widget:
m_dummyParent = new LIB_SYMBOL( *static_cast<LIB_SYMBOL*>( m_pin->GetParentSymbol() ) );
// Move everything in the copied symbol to unit 1; we'll use unit 2 for the dummy pin:
m_dummyParent->SetUnitCount( 2, false );
m_dummyParent->RunOnChildren( [&]( SCH_ITEM* child )
{
child->SetUnit( 1 );
} );
m_dummyPin = new SCH_PIN( *m_pin );
m_dummyPin->SetParent( m_dummyParent );
m_dummyPin->SetUnit( 2 );
m_dummyParent->AddDrawItem( m_dummyPin, false );
m_dummyParent->SetShowPinNames( true );
m_dummyParent->SetShowPinNumbers( true );
COLOR4D bgColor = parent->GetRenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND );
m_panelShowPin->SetBackgroundColour( bgColor.ToColour() );
m_previewWidget = new SYMBOL_PREVIEW_WIDGET( m_panelShowPin, &m_frame->Kiway(), false,
m_frame->GetCanvas()->GetBackend() );
const wxArrayString& orientationNames = PinOrientationNames();
m_previewWidget->SetLayoutDirection( wxLayout_LeftToRight );
m_previewWidget->DisplayPart( m_dummyParent, m_dummyPin->GetUnit(), 0 );
wxBoxSizer* previewSizer = new wxBoxSizer( wxHORIZONTAL );
previewSizer->Add( m_previewWidget, 1, wxEXPAND, 5 );
m_panelShowPin->SetSizer( previewSizer );
const wxArrayString& orientationNames = PinOrientationNames();
const std::vector<BITMAPS>& orientationIcons = PinOrientationIcons();
for ( unsigned ii = 0; ii < orientationNames.GetCount(); ii++ )
{
m_choiceOrientation->Insert( orientationNames[ii], KiBitmapBundle( orientationIcons[ii] ),
ii );
}
// We can't set the tab order through wxWidgets due to shortcomings in their mnemonics
// implementation on MSW
@ -242,7 +262,6 @@ DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES( SYMBOL_EDIT_FRAME* parent, SCH_PIN
DIALOG_PIN_PROPERTIES::~DIALOG_PIN_PROPERTIES()
{
delete m_dummyPin;
delete m_dummyParent;
// Prevents crash bug in wxGrid's d'tor
@ -379,44 +398,6 @@ bool DIALOG_PIN_PROPERTIES::TransferDataFromWindow()
}
void DIALOG_PIN_PROPERTIES::OnPaintShowPanel( wxPaintEvent& event )
{
wxPaintDC dc( m_panelShowPin );
wxSize dc_size = dc.GetSize();
dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );
// Give a parent to m_dummyPin for draw purposes.
// In fact m_dummyPin should not have a parent, but draw functions need a parent
// to know some options, about pin texts
SYMBOL_EDIT_FRAME* symbolEditor = (SYMBOL_EDIT_FRAME*) GetParent();
// Calculate a suitable scale to fit the available draw area
BOX2I bBox = m_dummyPin->GetBoundingBox( true, true, false );
bBox.Inflate( schIUScale.MilsToIU( DANGLING_SYMBOL_SIZE ) );
double xscale = (double) dc_size.x / bBox.GetWidth();
double yscale = (double) dc_size.y / bBox.GetHeight();
double scale = std::min( xscale, yscale );
// Give a 7% margin (each side) and limit to no more than 100% zoom
scale = std::min( scale * 0.85, 1.0 );
dc.SetUserScale( scale, scale );
GRResetPenAndBrush( &dc );
SCH_RENDER_SETTINGS renderSettings( *symbolEditor->GetRenderSettings() );
renderSettings.m_ShowPinNumbers = true;
renderSettings.m_ShowPinNames = true;
renderSettings.m_ShowHiddenFields = true;
renderSettings.m_ShowConnectionPoints = true;
renderSettings.m_Transform = TRANSFORM();
renderSettings.SetPrintDC( &dc );
m_dummyPin->Print( &renderSettings, 0, 0, -bBox.Centre(), false, false );
event.Skip();
}
void DIALOG_PIN_PROPERTIES::OnPropertiesChange( wxCommandEvent& event )
{
if( !IsShownOnScreen() ) // do nothing at init time
@ -435,7 +416,7 @@ void DIALOG_PIN_PROPERTIES::OnPropertiesChange( wxCommandEvent& event )
if( event.GetEventObject() == m_checkApplyToAllParts && m_frame->m_SyncPinEdit )
m_infoBar->ShowMessage( getSyncPinsMessage() );
m_panelShowPin->Refresh();
m_previewWidget->DisplayPart( m_dummyParent, m_dummyPin->GetUnit(), 0 );
}

View File

@ -48,6 +48,7 @@ enum COL_ORDER
class ALT_PIN_DATA_MODEL;
class SYMBOL_PREVIEW_WIDGET;
class DIALOG_PIN_PROPERTIES : public DIALOG_PIN_PROPERTIES_BASE
@ -59,10 +60,6 @@ public:
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
/**
* Draw (on m_panelShowPin) the pin according to current settings in dialog.
*/
void OnPaintShowPanel( wxPaintEvent& event ) override;
void OnPropertiesChange( wxCommandEvent& event ) override;
void OnAddAlternate( wxCommandEvent& event ) override;
void OnDeleteAlternate( wxCommandEvent& event ) override;
@ -75,29 +72,30 @@ protected:
wxString getSyncPinsMessage();
private:
SYMBOL_EDIT_FRAME* m_frame;
SCH_PIN* m_pin;
SYMBOL_EDIT_FRAME* m_frame;
SCH_PIN* m_pin;
LIB_SYMBOL* m_dummyParent;
SCH_PIN* m_dummyPin; // a working copy used to show changes
LIB_SYMBOL* m_dummyParent;
SCH_PIN* m_dummyPin; // a working copy used to show changes
SYMBOL_PREVIEW_WIDGET* m_previewWidget;
UNIT_BINDER m_posX;
UNIT_BINDER m_posY;
UNIT_BINDER m_pinLength;
UNIT_BINDER m_nameSize;
UNIT_BINDER m_numberSize;
UNIT_BINDER m_posX;
UNIT_BINDER m_posY;
UNIT_BINDER m_pinLength;
UNIT_BINDER m_nameSize;
UNIT_BINDER m_numberSize;
VECTOR2I m_origPos;
VECTOR2I m_origPos;
ALT_PIN_DATA_MODEL* m_alternatesDataModel;
ALT_PIN_DATA_MODEL* m_alternatesDataModel;
int m_delayedFocusRow;
int m_delayedFocusColumn;
int m_delayedFocusRow;
int m_delayedFocusColumn;
std::map<int, int> m_originalColWidths; // map col-number : orig-col-width
wxSize m_size;
bool m_initialized;
inline static bool s_alternatesTurndownOpen = false;
std::map<int, int> m_originalColWidths; // map col-number : orig-col-width
wxSize m_size;
bool m_initialized;
inline static bool s_alternatesTurndownOpen = false;
};
#endif // DIALOG_PIN_PROPERTIES_H

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -285,7 +285,6 @@ DIALOG_PIN_PROPERTIES_BASE::DIALOG_PIN_PROPERTIES_BASE( wxWindow* parent, wxWind
m_checkApplyToAllParts->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnPropertiesChange ), NULL, this );
m_checkApplyToAllBodyStyles->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnPropertiesChange ), NULL, this );
m_checkShow->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnPropertiesChange ), NULL, this );
m_panelShowPin->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnPaintShowPanel ), NULL, this );
m_alternatesTurndown->Connect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnCollapsiblePaneChange ), NULL, this );
m_addAlternate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnAddAlternate ), NULL, this );
m_deleteAlternate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnDeleteAlternate ), NULL, this );
@ -307,7 +306,6 @@ DIALOG_PIN_PROPERTIES_BASE::~DIALOG_PIN_PROPERTIES_BASE()
m_checkApplyToAllParts->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnPropertiesChange ), NULL, this );
m_checkApplyToAllBodyStyles->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnPropertiesChange ), NULL, this );
m_checkShow->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnPropertiesChange ), NULL, this );
m_panelShowPin->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnPaintShowPanel ), NULL, this );
m_alternatesTurndown->Disconnect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnCollapsiblePaneChange ), NULL, this );
m_addAlternate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnAddAlternate ), NULL, this );
m_deleteAlternate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PIN_PROPERTIES_BASE::OnDeleteAlternate ), NULL, this );

View File

@ -1,34 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="17"/>
<FileVersion major="1" minor="18"/>
<object class="Project" expanded="true">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="cpp_class_decoration"></property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
<property name="cpp_use_array_enum">0</property>
<property name="cpp_use_enum">1</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_pin_properties_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">dialog_pin_properties</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="php_disconnect_events">0</property>
<property name="php_disconnect_mode">source_name</property>
<property name="php_skip_events">1</property>
<property name="python_disconnect_events">0</property>
<property name="python_disconnect_mode">source_name</property>
<property name="python_image_path_wrapper_function_name"></property>
<property name="python_indent_with_spaces"></property>
<property name="python_skip_events">1</property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<property name="use_native_eol">0</property>
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
@ -73,10 +75,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -170,10 +172,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -235,10 +237,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -304,10 +306,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -369,10 +371,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -438,10 +440,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -503,10 +505,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -571,10 +573,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -636,10 +638,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -704,10 +706,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -769,10 +771,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -838,10 +840,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -903,10 +905,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -972,10 +974,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1037,10 +1039,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1106,10 +1108,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1171,10 +1173,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1241,10 +1243,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1306,10 +1308,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1376,10 +1378,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1441,10 +1443,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1511,10 +1513,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1576,10 +1578,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1641,10 +1643,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1706,10 +1708,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1771,10 +1773,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1855,10 +1857,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1921,10 +1923,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1997,10 +1999,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -2065,10 +2067,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -2127,10 +2129,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -2174,7 +2176,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL</property>
<event name="OnPaint">OnPaintShowPanel</event>
</object>
</object>
</object>
@ -2199,10 +2200,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -2277,10 +2278,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
@ -2377,10 +2378,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
@ -2462,10 +2463,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -93,7 +93,6 @@ class DIALOG_PIN_PROPERTIES_BASE : public DIALOG_SHIM
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); }
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnPropertiesChange( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPaintShowPanel( wxPaintEvent& event ) { event.Skip(); }
virtual void OnCollapsiblePaneChange( wxCollapsiblePaneEvent& event ) { event.Skip(); }
virtual void OnAddAlternate( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDeleteAlternate( wxCommandEvent& event ) { event.Skip(); }

View File

@ -598,100 +598,6 @@ bool LIB_SYMBOL::ResolveTextVar( wxString* token, int aDepth ) const
}
void LIB_SYMBOL::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
{
for( SCH_ITEM& item : m_drawings )
{
// Do not print private items
if( item.IsPrivate() )
continue;
// Do not draw items not attached to the current part
if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
continue;
if( aBodyStyle && item.m_bodyStyle && ( item.m_bodyStyle != aBodyStyle ) )
continue;
if( item.Type() == SCH_PIN_T )
{
item.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
}
else if( item.Type() == SCH_FIELD_T )
{
SCH_FIELD& field = static_cast<SCH_FIELD&>( item );
if( ( field.IsVisible() && aSettings->m_ShowVisibleFields )
|| ( !field.IsVisible() && aSettings->m_ShowHiddenFields ) )
{
item.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
}
}
else if( item.Type() == SCH_SHAPE_T )
{
SCH_SHAPE& shape = static_cast<SCH_SHAPE&>( item );
if( shape.GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
aForceNoFill = true;
// Ensure the color of shape is from LAYER_DEVICE if not specified.
COLOR4D init_color = shape.GetStroke().GetColor();
STROKE_PARAMS prms = shape.GetStroke();
if( init_color == COLOR4D::UNSPECIFIED )
{
COLOR4D color = aSettings->GetLayerColor( LAYER_DEVICE );
prms.SetColor( color );
shape.SetStroke( prms );
}
shape.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
prms.SetColor( init_color );
shape.SetStroke( prms );
}
else
{
item.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
}
}
}
void LIB_SYMBOL::PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aDimmed )
{
/* draw background for filled items using background option
* Solid lines will be drawn after the background
* Note also, background is not drawn when printing in black and white
*/
if( !GetGRForceBlackPenState() )
{
for( SCH_ITEM& item : m_drawings )
{
// Do not print private items
if( item.IsPrivate() )
continue;
if( item.Type() == SCH_SHAPE_T )
{
SCH_SHAPE& shape = static_cast<SCH_SHAPE&>( item );
// Do not draw items not attached to the current part
if( aUnit && shape.m_unit && ( shape.m_unit != aUnit ) )
continue;
if( aBodyStyle && shape.m_bodyStyle && ( shape.m_bodyStyle != aBodyStyle ) )
continue;
if( shape.GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
shape.Print( aSettings, aUnit, aBodyStyle, aOffset, false, aDimmed );
}
}
}
}
void LIB_SYMBOL::Plot( PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed )
{

View File

@ -391,12 +391,6 @@ public:
*/
bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
void PrintBackground( const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aDimmed ) override;
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;

View File

@ -95,7 +95,6 @@ DIALOG_PRINT::DIALOG_PRINT( SCH_EDIT_FRAME* aParent ) :
m_parent( aParent )
{
wxASSERT( aParent );
m_useCairo = ADVANCED_CFG::GetCfg().m_EnableEeschemaPrintCairo;
// Show m_panelPrinters only if there are printers to list:
m_panelPrinters->Show( m_panelPrinters->AsPrintersAvailable() );
@ -111,8 +110,7 @@ DIALOG_PRINT::DIALOG_PRINT( SCH_EDIT_FRAME* aParent ) :
#if defined(__WXGTK__)
// Preview using Cairo does not work on GTK,
// but this platform provide native print preview
if( m_useCairo )
m_sdbSizerApply->Hide();
m_sdbSizerApply->Hide();
#endif
m_sdbSizerOK->SetFocus();
@ -258,9 +256,8 @@ void DIALOG_PRINT::OnPrintPreview( wxCommandEvent& event )
// Pass two printout objects: for preview, and possible printing.
wxString title = _( "Preview" );
wxPrintPreview* preview = new wxPrintPreview( new SCH_PRINTOUT( m_parent, title, m_useCairo ),
new SCH_PRINTOUT( m_parent, title, m_useCairo ),
&prn_data );
wxPrintPreview* preview = new wxPrintPreview( new SCH_PRINTOUT( m_parent, title ),
new SCH_PRINTOUT( m_parent, title ), &prn_data );
preview->SetZoom( 100 );
@ -378,7 +375,7 @@ bool DIALOG_PRINT::TransferDataFromWindow()
printDialogData.EnablePageNumbers( true );
wxPrinter printer( &printDialogData );
SCH_PRINTOUT printout( m_parent, _( "Print Schematic" ), m_useCairo );
SCH_PRINTOUT printout( m_parent, _( "Print Schematic" ) );
Pgm().m_Printing = true;
{

View File

@ -47,7 +47,6 @@ private:
private:
SCH_EDIT_FRAME* m_parent;
bool m_useCairo;
};

View File

@ -41,12 +41,11 @@
#include <wx/log.h>
SCH_PRINTOUT::SCH_PRINTOUT( SCH_EDIT_FRAME* aParent, const wxString& aTitle, bool aUseCairo ) :
SCH_PRINTOUT::SCH_PRINTOUT( SCH_EDIT_FRAME* aParent, const wxString& aTitle ) :
wxPrintout( aTitle )
{
wxASSERT( aParent != nullptr );
m_parent = aParent;
m_useCairo = aUseCairo;
m_view = nullptr;
}
@ -126,325 +125,167 @@ int SCH_PRINTOUT::milsToIU( int aMils )
bool SCH_PRINTOUT::PrintPage( SCH_SCREEN* aScreen, wxDC* aDC, bool aForPrinting )
{
// Note: some data (like paper size) is available only when printing
wxDC* dc = aDC;
m_view = m_parent->GetCanvas()->GetView();
KIGFX::GAL_DISPLAY_OPTIONS options;
options.cairo_antialiasing_mode = KIGFX::CAIRO_ANTIALIASING_MODE::GOOD;
std::unique_ptr<KIGFX::GAL_PRINT> galPrint = KIGFX::GAL_PRINT::Create( options, dc );
KIGFX::GAL* gal = galPrint->GetGAL();
KIGFX::PRINT_CONTEXT* printCtx = galPrint->GetPrintCtx();
std::unique_ptr<KIGFX::SCH_PAINTER> painter = std::make_unique<KIGFX::SCH_PAINTER>( gal );
std::unique_ptr<KIGFX::VIEW> view( m_view->DataReference() );
if( !m_useCairo )
painter->SetSchematic( &m_parent->Schematic() );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EESCHEMA_SETTINGS* cfg = m_parent->eeconfig();
COLOR_SETTINGS* theme = mgr.GetColorSettings( cfg->m_Printing.color_theme );
EE_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool<EE_SELECTION_TOOL>();
// Target paper size
wxRect pageSizePix;
wxSize dcPPI = dc->GetPPI();
if( aForPrinting )
pageSizePix = GetLogicalPageRect();
else
{
// Version using print to a wxDC
// Warning:
// When printing many pages, changes in the current wxDC will affect all next printings
// because all prints are using the same wxPrinterDC after creation
// So be careful and reinit parameters, especially when using offsets.
dc->SetUserScale( 1, 1 );
VECTOR2I tmp_startvisu;
wxSize pageSizeIU; // Page size in internal units
VECTOR2I old_org;
wxRect fitRect;
wxDC* dc = aDC;
wxBusyCursor dummy;
// Save current offsets and clip box.
tmp_startvisu = aScreen->m_StartVisu;
old_org = aScreen->m_DrawOrg;
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EESCHEMA_SETTINGS* cfg = m_parent->eeconfig();
COLOR_SETTINGS* theme = mgr.GetColorSettings( cfg->m_Printing.color_theme );
// Change scale factor and offset to print the whole page.
bool printDrawingSheet = cfg->m_Printing.title_block;
pageSizeIU = ToWxSize( aScreen->GetPageSettings().GetSizeIU( schIUScale.IU_PER_MILS ) );
FitThisSizeToPaper( pageSizeIU );
if( aForPrinting )
fitRect = GetLogicalPaperRect();
else
if( wxMemoryDC* memdc = dynamic_cast<wxMemoryDC*>( dc ) )
{
fitRect = wxRect( 0, 0, 6000, 4000 );
if( wxMemoryDC* memdc = dynamic_cast<wxMemoryDC*>( dc ) )
{
wxBitmap& bm = memdc->GetSelectedBitmap();
fitRect = wxRect( 0, 0, bm.GetWidth(), bm.GetHeight() );
// If the dc is a memory dc (should be the case when not printing on a printer,
// i.e. when printing on the clipboard), calculate a suitable dc user scale
double dc_scale;
double ppi = 300; // Use 300 pixels per inch to create bitmap images on start
double inch2Iu = 1000.0 * schIUScale.IU_PER_MILS;
dc_scale = ppi / inch2Iu;
dc->SetUserScale( dc_scale, dc_scale );
}
}
// When is the actual paper size does not match the schematic page size, the drawing will
// not be centered on X or Y axis. Give a draw offset to center the schematic page on the
// paper draw area.
int xoffset = ( fitRect.width - pageSizeIU.x ) / 2;
int yoffset = ( fitRect.height - pageSizeIU.y ) / 2;
// Using a wxAffineMatrix2D has a big advantage: it handles different pages orientations
//(PORTRAIT/LANDSCAPE), but the affine matrix is not always supported
if( dc->CanUseTransformMatrix() && aForPrinting )
{
wxAffineMatrix2D matrix; // starts from a unity matrix (the current wxDC default)
// Check for portrait/landscape mismatch:
if( ( fitRect.width > fitRect.height ) != ( pageSizeIU.x > pageSizeIU.y ) )
{
// Rotate the coordinates, and keep the draw coordinates inside the page
matrix.Rotate( M_PI_2 );
matrix.Translate( 0, -pageSizeIU.y );
// Recalculate the offsets and page sizes according to the page rotation
std::swap( pageSizeIU.x, pageSizeIU.y );
FitThisSizeToPaper( pageSizeIU );
fitRect = GetLogicalPaperRect();
xoffset = ( fitRect.width - pageSizeIU.x ) / 2;
yoffset = ( fitRect.height - pageSizeIU.y ) / 2;
// All the coordinates will be rotated 90 deg when printing,
// so the X,Y offset vector must be rotated -90 deg before printing
std::swap( xoffset, yoffset );
std::swap( fitRect.width, fitRect.height );
yoffset = -yoffset;
}
matrix.Translate( xoffset, yoffset );
dc->SetTransformMatrix( matrix );
fitRect.x -= xoffset;
fitRect.y -= yoffset;
}
else if( aForPrinting )
{
SetLogicalOrigin( 0, 0 ); // Reset all offset settings made previously.
// When printing previous pages (all prints are using the same wxDC)
OffsetLogicalOrigin( xoffset, yoffset );
}
dc->SetLogicalFunction( wxCOPY );
GRResetPenAndBrush( dc );
COLOR4D savedBgColor = m_parent->GetDrawBgColor();
COLOR4D bgColor = m_parent->GetColorSettings()->GetColor( LAYER_SCHEMATIC_BACKGROUND );
if( cfg->m_Printing.background )
{
if( cfg->m_Printing.use_theme && theme )
bgColor = theme->GetColor( LAYER_SCHEMATIC_BACKGROUND );
wxBitmap& bm = memdc->GetSelectedBitmap();
pageSizePix = wxRect( 0, 0, bm.GetWidth(), bm.GetHeight() );
}
else
{
bgColor = COLOR4D::WHITE;
return false;
}
}
m_parent->SetDrawBgColor( bgColor );
const VECTOR2D pageSizeIn( (double) pageSizePix.width / dcPPI.x,
(double) pageSizePix.height / dcPPI.y );
const VECTOR2D pageSizeIU( milsToIU( pageSizeIn.x * 1000 ), milsToIU( pageSizeIn.y * 1000 ) );
GRSFilledRect( dc, fitRect.GetX(), fitRect.GetY(), fitRect.GetRight(), fitRect.GetBottom(), 0,
bgColor, bgColor );
galPrint->SetSheetSize( pageSizeIn );
if( cfg->m_Printing.monochrome )
GRForceBlackPen( true );
view->SetGAL( gal );
view->SetPainter( painter.get() );
view->SetScaleLimits( ZOOM_MAX_LIMIT_EESCHEMA, ZOOM_MIN_LIMIT_EESCHEMA );
view->SetScale( 1.0 );
gal->SetWorldUnitLength( SCH_WORLD_UNIT );
SCH_RENDER_SETTINGS renderSettings( *m_parent->GetRenderSettings() );
renderSettings.SetPrintDC( dc );
// Init the SCH_RENDER_SETTINGS used by the painter used to print schematic
SCH_RENDER_SETTINGS* dstSettings = painter->GetSettings();
dstSettings->m_ShowPinsElectricalType = false;
// Set the color scheme
dstSettings->LoadColors( m_parent->GetColorSettings( false ) );
if( cfg->m_Printing.use_theme && theme )
dstSettings->LoadColors( theme );
bool printDrawingSheet = cfg->m_Printing.title_block;
COLOR4D bgColor = m_parent->GetColorSettings()->GetColor( LAYER_SCHEMATIC_BACKGROUND );
if( cfg->m_Printing.background )
{
if( cfg->m_Printing.use_theme && theme )
renderSettings.LoadColors( theme );
renderSettings.SetBackgroundColor( bgColor );
// The drawing-sheet-item print code is shared between PCBNew and Eeschema, so it's easier
// if they just use the PCB layer.
renderSettings.SetLayerColor( LAYER_DRAWINGSHEET,
renderSettings.GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET ) );
renderSettings.SetDefaultFont( cfg->m_Appearance.default_font );
if( printDrawingSheet )
{
m_parent->PrintDrawingSheet( &renderSettings, aScreen, aScreen->Schematic()->GetProperties(),
schIUScale.IU_PER_MILS, aScreen->GetFileName(), wxEmptyString );
}
renderSettings.SetIsPrinting( true );
aScreen->Print( &renderSettings );
m_parent->SetDrawBgColor( savedBgColor );
GRForceBlackPen( false );
aScreen->m_StartVisu = tmp_startvisu;
aScreen->m_DrawOrg = old_org;
bgColor = theme->GetColor( LAYER_SCHEMATIC_BACKGROUND );
}
else
{
wxDC* dc = aDC;
m_view = m_parent->GetCanvas()->GetView();
KIGFX::GAL_DISPLAY_OPTIONS options;
options.cairo_antialiasing_mode = KIGFX::CAIRO_ANTIALIASING_MODE::GOOD;
std::unique_ptr<KIGFX::GAL_PRINT> galPrint = KIGFX::GAL_PRINT::Create( options, dc );
KIGFX::GAL* gal = galPrint->GetGAL();
KIGFX::PRINT_CONTEXT* printCtx = galPrint->GetPrintCtx();
std::unique_ptr<KIGFX::SCH_PAINTER> painter = std::make_unique<KIGFX::SCH_PAINTER>( gal );
std::unique_ptr<KIGFX::VIEW> view( m_view->DataReference() );
bgColor = COLOR4D::WHITE;
}
painter->SetSchematic( &m_parent->Schematic() );
dstSettings->SetBackgroundColor( bgColor );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
EESCHEMA_SETTINGS* cfg = m_parent->eeconfig();
COLOR_SETTINGS* theme = mgr.GetColorSettings( cfg->m_Printing.color_theme );
EE_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool<EE_SELECTION_TOOL>();
// The drawing-sheet-item print code is shared between PCBNew and Eeschema, so it's easier
// if they just use the PCB layer.
dstSettings->SetLayerColor( LAYER_DRAWINGSHEET,
dstSettings->GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET ) );
// Target paper size
wxRect pageSizePix;
wxSize dcPPI = dc->GetPPI();
dstSettings->SetDefaultFont( cfg->m_Appearance.default_font );
if( aForPrinting )
pageSizePix = GetLogicalPageRect();
else
if( cfg->m_Printing.monochrome )
{
for( int i = 0; i < LAYER_ID_COUNT; ++i )
dstSettings->SetLayerColor( i, COLOR4D::BLACK );
// In B&W mode, draw the background only in white, because any other color
// will be replaced by a black background
dstSettings->SetBackgroundColor( COLOR4D::WHITE );
dstSettings->m_OverrideItemColors = true;
// Disable print some backgrounds
dstSettings->SetPrintBlackAndWhite( true );
}
else // color enabled
{
for( int i = 0; i < LAYER_ID_COUNT; ++i )
{
dc->SetUserScale( 1, 1 );
if( wxMemoryDC* memdc = dynamic_cast<wxMemoryDC*>( dc ) )
{
wxBitmap& bm = memdc->GetSelectedBitmap();
pageSizePix = wxRect( 0, 0, bm.GetWidth(), bm.GetHeight() );
}
else
{
return false;
}
// Cairo does not support translucent colors on PostScript surfaces
// see 'Features support by the PostScript surface' on
// https://www.cairographics.org/documentation/using_the_postscript_surface/
dstSettings->SetLayerColor( i, dstSettings->GetLayerColor( i ).WithAlpha( 1.0 ) );
}
}
const VECTOR2D pageSizeIn( (double) pageSizePix.width / dcPPI.x,
(double) pageSizePix.height / dcPPI.y );
const VECTOR2D pageSizeIU( milsToIU( pageSizeIn.x * 1000 ), milsToIU( pageSizeIn.y * 1000 ) );
dstSettings->SetIsPrinting( true );
galPrint->SetSheetSize( pageSizeIn );
VECTOR2I sheetSizeIU = aScreen->GetPageSettings().GetSizeIU( schIUScale.IU_PER_MILS );
BOX2I drawingAreaBBox = BOX2I( VECTOR2I( 0, 0 ), VECTOR2I( sheetSizeIU ) );
view->SetGAL( gal );
view->SetPainter( painter.get() );
view->SetScaleLimits( ZOOM_MAX_LIMIT_EESCHEMA, ZOOM_MIN_LIMIT_EESCHEMA );
view->SetScale( 1.0 );
gal->SetWorldUnitLength( SCH_WORLD_UNIT );
// Enable all layers and use KIGFX::TARGET_NONCACHED to force update drawings
// for printing with current GAL instance
for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; ++i )
{
view->SetLayerVisible( i, true );
view->SetLayerTarget( i, KIGFX::TARGET_NONCACHED );
}
// Init the SCH_RENDER_SETTINGS used by the painter used to print schematic
SCH_RENDER_SETTINGS* dstSettings = painter->GetSettings();
view->SetLayerVisible( LAYER_DRAWINGSHEET, printDrawingSheet );
dstSettings->m_ShowPinsElectricalType = false;
// Set the color scheme
dstSettings->LoadColors( m_parent->GetColorSettings( false ) );
if( cfg->m_Printing.use_theme && theme )
dstSettings->LoadColors( theme );
bool printDrawingSheet = cfg->m_Printing.title_block;
COLOR4D bgColor = m_parent->GetColorSettings()->GetColor( LAYER_SCHEMATIC_BACKGROUND );
if( cfg->m_Printing.background )
// Don't draw the selection if it's not from the current screen
for( EDA_ITEM* item : selTool->GetSelection() )
{
if( SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item ) )
{
if( cfg->m_Printing.use_theme && theme )
bgColor = theme->GetColor( LAYER_SCHEMATIC_BACKGROUND );
}
else
{
bgColor = COLOR4D::WHITE;
if( !m_parent->GetScreen()->CheckIfOnDrawList( schItem ) )
view->SetLayerVisible( LAYER_SELECT_OVERLAY, false );
break;
}
}
dstSettings->SetBackgroundColor( bgColor );
// When is the actual paper size does not match the schematic page size,
// we need to adjust the print scale to fit the selected paper size (pageSizeIU)
double scaleX = (double) pageSizeIU.x / drawingAreaBBox.GetWidth();
double scaleY = (double) pageSizeIU.y / drawingAreaBBox.GetHeight();
// The drawing-sheet-item print code is shared between PCBNew and Eeschema, so it's easier
// if they just use the PCB layer.
dstSettings->SetLayerColor( LAYER_DRAWINGSHEET,
dstSettings->GetLayerColor( LAYER_SCHEMATIC_DRAWINGSHEET ) );
double print_scale = std::min( scaleX, scaleY );
dstSettings->SetDefaultFont( cfg->m_Appearance.default_font );
galPrint->SetNativePaperSize( pageSizeIn, printCtx->HasNativeLandscapeRotation() );
gal->SetLookAtPoint( drawingAreaBBox.Centre() );
gal->SetZoomFactor( print_scale );
gal->SetClearColor( dstSettings->GetBackgroundColor() );
if( cfg->m_Printing.monochrome )
{
for( int i = 0; i < LAYER_ID_COUNT; ++i )
dstSettings->SetLayerColor( i, COLOR4D::BLACK );
// Clearing the screen for the background color needs the screen set to the page size
// in pixels. This can ?somehow? prevent some but not all foreground elements from being printed
// TODO: figure out what's going on here and fix printing. See also board_printout
VECTOR2I size = gal->GetScreenPixelSize();
gal->ResizeScreen( pageSizePix.GetWidth(),pageSizePix.GetHeight() );
gal->ClearScreen();
gal->ResizeScreen( size.x, size.y );
// In B&W mode, draw the background only in white, because any other color
// will be replaced by a black background
dstSettings->SetBackgroundColor( COLOR4D::WHITE );
dstSettings->m_OverrideItemColors = true;
// Needed to use the same order for printing as for screen redraw
view->UseDrawPriority( true );
// Disable print some backgrounds
dstSettings->SetPrintBlackAndWhite( true );
}
else // color enabled
{
for( int i = 0; i < LAYER_ID_COUNT; ++i )
{
// Cairo does not support translucent colors on PostScript surfaces
// see 'Features support by the PostScript surface' on
// https://www.cairographics.org/documentation/using_the_postscript_surface/
dstSettings->SetLayerColor( i, dstSettings->GetLayerColor( i ).WithAlpha( 1.0 ) );
}
}
dstSettings->SetIsPrinting( true );
VECTOR2I sheetSizeIU = aScreen->GetPageSettings().GetSizeIU( schIUScale.IU_PER_MILS );
BOX2I drawingAreaBBox = BOX2I( VECTOR2I( 0, 0 ), VECTOR2I( sheetSizeIU ) );
// Enable all layers and use KIGFX::TARGET_NONCACHED to force update drawings
// for printing with current GAL instance
for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; ++i )
{
view->SetLayerVisible( i, true );
view->SetLayerTarget( i, KIGFX::TARGET_NONCACHED );
}
view->SetLayerVisible( LAYER_DRAWINGSHEET, printDrawingSheet );
// Don't draw the selection if it's not from the current screen
for( EDA_ITEM* item : selTool->GetSelection() )
{
if( SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item ) )
{
if( !m_parent->GetScreen()->CheckIfOnDrawList( schItem ) )
view->SetLayerVisible( LAYER_SELECT_OVERLAY, false );
break;
}
}
// When is the actual paper size does not match the schematic page size,
// we need to adjust the print scale to fit the selected paper size (pageSizeIU)
double scaleX = (double) pageSizeIU.x / drawingAreaBBox.GetWidth();
double scaleY = (double) pageSizeIU.y / drawingAreaBBox.GetHeight();
double print_scale = std::min( scaleX, scaleY );
galPrint->SetNativePaperSize( pageSizeIn, printCtx->HasNativeLandscapeRotation() );
gal->SetLookAtPoint( drawingAreaBBox.Centre() );
gal->SetZoomFactor( print_scale );
gal->SetClearColor( dstSettings->GetBackgroundColor() );
// Clearing the screen for the background color needs the screen set to the page size
// in pixels. This can ?somehow? prevent some but not all foreground elements from being printed
// TODO: figure out what's going on here and fix printing. See also board_printout
VECTOR2I size = gal->GetScreenPixelSize();
gal->ResizeScreen( pageSizePix.GetWidth(),pageSizePix.GetHeight() );
gal->ClearScreen();
gal->ResizeScreen( size.x, size.y );
// Needed to use the same order for printing as for screen redraw
view->UseDrawPriority( true );
{
KIGFX::GAL_DRAWING_CONTEXT ctx( gal );
view->Redraw();
}
{
KIGFX::GAL_DRAWING_CONTEXT ctx( gal );
view->Redraw();
}
return true;

View File

@ -38,7 +38,7 @@ class PAINTER;
class SCH_PRINTOUT : public wxPrintout
{
public:
SCH_PRINTOUT( SCH_EDIT_FRAME* aParent, const wxString& aTitle, bool aUseCairo );
SCH_PRINTOUT( SCH_EDIT_FRAME* aParent, const wxString& aTitle );
bool OnPrintPage( int page ) override;
bool HasPage( int page ) override;
@ -58,10 +58,9 @@ public:
bool PrintPage( SCH_SCREEN* aScreen, wxDC* aDC, bool aForPrinting );
private:
SCH_EDIT_FRAME* m_parent;
SCH_EDIT_FRAME* m_parent;
///< Source VIEW object (note that actual printing only refers to this object)
const KIGFX::SCH_VIEW* m_view;
bool m_useCairo;
int milsToIU( int aMils );
};

View File

@ -102,16 +102,6 @@ const BOX2I SCH_BITMAP::GetBoundingBox() const
}
void SCH_BITMAP::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
{
VECTOR2I pos = GetPosition() + aOffset;
m_referenceImage.GetImage().DrawBitmap( aSettings->GetPrintDC(), pos,
aSettings->GetBackgroundColor() );
}
VECTOR2I SCH_BITMAP::GetPosition() const
{
return m_referenceImage.GetPosition();
@ -176,9 +166,11 @@ void SCH_BITMAP::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS&
{
if( aBackground )
{
m_referenceImage.GetImage().PlotImage(
aPlotter, GetPosition(), aPlotter->RenderSettings()->GetLayerColor( GetLayer() ),
aPlotter->RenderSettings()->GetDefaultPenWidth() );
RENDER_SETTINGS* cfg = aPlotter->RenderSettings();
m_referenceImage.GetImage().PlotImage( aPlotter, GetPosition(),
cfg->GetLayerColor( GetLayer() ),
cfg->GetDefaultPenWidth() );
}
}

View File

@ -103,12 +103,6 @@ public:
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aDimmed ) override {}
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;

View File

@ -263,34 +263,6 @@ void SCH_BUS_BUS_ENTRY::GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemLis
}
void SCH_BUS_ENTRY_BASE::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
{
wxDC* DC = aSettings->GetPrintDC();
COLOR4D color = ( GetBusEntryColor() == COLOR4D::UNSPECIFIED )
? aSettings->GetLayerColor( m_layer )
: GetBusEntryColor();
VECTOR2I start = m_pos + aOffset;
VECTOR2I end = GetEnd() + aOffset;
int penWidth = ( GetPenWidth() == 0 ) ? aSettings->GetDefaultPenWidth() : GetPenWidth();
if( GetEffectiveLineStyle() <= LINE_STYLE::FIRST_TYPE )
{
GRLine( DC, start.x, start.y, end.x, end.y, penWidth, color );
}
else
{
SHAPE_SEGMENT segment( start, end );
STROKE_PARAMS::Stroke( &segment, GetEffectiveLineStyle(), penWidth, aSettings,
[&]( const VECTOR2I& a, const VECTOR2I& b )
{
GRLine( DC, a.x, a.y, b.x, b.y, penWidth, color );
} );
}
}
void SCH_BUS_ENTRY_BASE::MirrorVertically( int aCenter )
{
MIRROR( m_pos.y, aCenter );

View File

@ -129,12 +129,6 @@ public:
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aDimmed ) override {}
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;

View File

@ -1515,22 +1515,6 @@ void SCH_EDIT_FRAME::OnExit( wxCommandEvent& event )
}
void SCH_EDIT_FRAME::PrintPage( const RENDER_SETTINGS* aSettings )
{
wxString fileName = Prj().AbsolutePath( GetScreen()->GetFileName() );
const SCH_RENDER_SETTINGS* cfg = static_cast<const SCH_RENDER_SETTINGS*>( aSettings );
COLOR4D bg = GetColorSettings()->GetColor( LAYER_SCHEMATIC_BACKGROUND );
cfg->GetPrintDC()->SetBackground( wxBrush( bg.ToColour() ) );
cfg->GetPrintDC()->Clear();
cfg->GetPrintDC()->SetLogicalFunction( wxCOPY );
GetScreen()->Print( cfg );
PrintDrawingSheet( cfg, GetScreen(), Schematic().GetProperties(), schIUScale.IU_PER_MILS,
fileName );
}
void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
{
SCHEMATIC_SETTINGS& settings = m_schematic->Settings();

View File

@ -812,11 +812,6 @@ public:
DESIGN_BLOCK_PANE* GetDesignBlockPane() const { return m_designBlocksPane; }
/**
* Plot or print the current sheet to the clipboard.
*/
virtual void PrintPage( const RENDER_SETTINGS* aSettings ) override;
void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; }
/**

View File

@ -423,90 +423,6 @@ SCH_FIELD::GetRenderCache( const wxString& forResolvedText, const VECTOR2I& forP
}
void SCH_FIELD::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
{
wxString text;
if( Schematic() )
text = GetShownText( &Schematic()->CurrentSheet(), true );
else
text = GetShownText( true );
if( ( !IsVisible() && !IsForceVisible() ) || text.IsEmpty() )
return;
wxDC* DC = aSettings->GetPrintDC();
COLOR4D color = aSettings->GetLayerColor( IsForceVisible() ? LAYER_HIDDEN : m_layer );
bool blackAndWhiteMode = GetGRForceBlackPenState();
int penWidth = GetEffectiveTextPenWidth( aSettings->GetDefaultPenWidth() );
COLOR4D bg = aSettings->GetBackgroundColor();
if( bg == COLOR4D::UNSPECIFIED || GetGRForceBlackPenState() )
bg = COLOR4D::WHITE;
if( IsForceVisible() )
bg = aSettings->GetLayerColor( LAYER_HIDDEN );
if( !blackAndWhiteMode && GetTextColor() != COLOR4D::UNSPECIFIED )
color = GetTextColor();
if( aDimmed )
{
color.Desaturate( );
color = color.Mix( bg, 0.5f );
}
// Calculate the text orientation according to the symbol orientation.
EDA_ANGLE orient = GetTextAngle();
VECTOR2I textpos = GetTextPos();
GR_TEXT_H_ALIGN_T hjustify = GetHorizJustify();
GR_TEXT_V_ALIGN_T vjustify = GetVertJustify();
KIFONT::FONT* font = GetFont();
if( !font )
font = KIFONT::FONT::GetFont( aSettings->GetDefaultFont(), IsBold(), IsItalic() );
if( m_parent && m_parent->Type() == LIB_SYMBOL_T )
{
textpos = aSettings->TransformCoordinate( GetTextPos() ) + aOffset;
}
else if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
{
/*
* Calculate the text justification, according to the symbol orientation/mirror.
* This is a bit complicated due to cumulative calculations:
* - numerous cases (mirrored or not, rotation)
* - the GRText function will also recalculate H and V justifications according to the
* text orientation.
* - when symbol is mirrored, the text is not mirrored and justifications are complicated
* to calculate so the easier way is to use no justifications (centered text) and use
* GetBoundingBox to know the text coordinate considered as centered
*/
hjustify = GR_TEXT_H_ALIGN_CENTER;
vjustify = GR_TEXT_V_ALIGN_CENTER;
textpos = GetBoundingBox().Centre() + aOffset;
if( aSettings->m_Transform.y1 ) // Rotate symbol 90 degrees.
{
if( orient == ANGLE_HORIZONTAL )
orient = ANGLE_VERTICAL;
else
orient = ANGLE_HORIZONTAL;
}
}
else if( m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T )
{
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( GetParent() );
textpos += label->GetSchematicTextOffset( aSettings );
}
GRPrintText( DC, textpos, color, text, orient, GetTextSize(), hjustify, vjustify, penWidth,
IsItalic(), IsBold(), font, GetFontMetrics() );
}
void SCH_FIELD::ImportValues( const SCH_FIELD& aSource )
{
SetAttributes( aSource );

View File

@ -284,9 +284,6 @@ public:
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;

View File

@ -577,30 +577,6 @@ public:
virtual void SetStroke( const STROKE_PARAMS& aStroke ) { wxCHECK( false, /* void */ ); }
/**
* Print an item.
*
* @param aUnit - Which unit to print.
* @param aBodyStyle - Which body style to print.
* @param aOffset - Relative offset.
* @param aForceNoFill - Disable printing of fills.
* @param aDimmed - Reduce brightness of item.
*/
virtual void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
{
wxCHECK_MSG( false, /*void*/, wxT( "Print not implemented in " ) + GetClass() );
}
/**
* Print just the background fills.
*/
virtual void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aDimmed )
{
wxCHECK_MSG( false, /*void*/, wxT( "PrintBackground not implemented in " ) + GetClass() );
}
/**
* Plot the item to \a aPlotter.
*

View File

@ -111,21 +111,6 @@ const BOX2I SCH_JUNCTION::GetBoundingBox() const
}
void SCH_JUNCTION::Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
{
wxDC* DC = aSettings->GetPrintDC();
COLOR4D color = GetJunctionColor();
if( color == COLOR4D::UNSPECIFIED )
color = aSettings->GetLayerColor( GetLayer() );
SHAPE_CIRCLE circle = getEffectiveShape();
GRFilledCircle( DC, circle.GetCenter() + aOffset, circle.GetRadius(), 0, color, color );
}
void SCH_JUNCTION::MirrorVertically( int aCenter )
{
MIRROR( m_pos.y, aCenter );

View File

@ -122,12 +122,6 @@ public:
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
const VECTOR2I& aOffset, bool aDimmed ) override {}
void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;

Some files were not shown because too many files have changed in this diff Show More