Eeschema, Libedit: fixes color artifacts when moving/placing a pin.
Very minor other fixes.
This commit is contained in:
parent
02bacd668e
commit
410644343d
|
@ -37,6 +37,16 @@ PLOTTER::PLOTTER( )
|
|||
negativeMode = false;
|
||||
}
|
||||
|
||||
PLOTTER::~PLOTTER()
|
||||
{
|
||||
// Emergency cleanup, but closing the file is
|
||||
// usually made in EndPlot().
|
||||
if( outputFile )
|
||||
{
|
||||
fclose( outputFile );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Open or create the plot file aFullFilename
|
||||
* return true if success, false if the file connot be created/opened
|
||||
|
|
|
@ -31,18 +31,7 @@
|
|||
#include <gr_basic.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <wxEeschemaStruct.h>
|
||||
#include <base_units.h>
|
||||
|
||||
#include <general.h>
|
||||
#include <class_library.h>
|
||||
#include <sch_bus_entry.h>
|
||||
#include <sch_component.h>
|
||||
#include <sch_junction.h>
|
||||
#include <sch_line.h>
|
||||
#include <sch_no_connect.h>
|
||||
#include <sch_polyline.h>
|
||||
#include <sch_sheet.h>
|
||||
#include <sch_sheet_path.h>
|
||||
|
||||
|
||||
void DrawDanglingSymbol( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& pos, EDA_COLOR_T Color )
|
||||
|
|
|
@ -114,8 +114,10 @@ bool LIB_ITEM::operator<( const LIB_ITEM& aOther ) const
|
|||
}
|
||||
|
||||
|
||||
void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, EDA_COLOR_T aColor,
|
||||
GR_DRAWMODE aDrawMode, void* aData, const TRANSFORM& aTransform )
|
||||
void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||
const wxPoint& aOffset, EDA_COLOR_T aColor,
|
||||
GR_DRAWMODE aDrawMode, void* aData,
|
||||
const TRANSFORM& aTransform )
|
||||
{
|
||||
if( InEditMode() )
|
||||
{
|
||||
|
@ -131,7 +133,8 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
|||
{
|
||||
GRSetDrawMode( aDC, g_XorMode );
|
||||
drawEditGraphics( aPanel->GetClipBox(), aDC, color );
|
||||
drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData, aTransform );
|
||||
drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData,
|
||||
aTransform );
|
||||
}
|
||||
#endif
|
||||
// Calculate the new attributes at the current cursor position.
|
||||
|
@ -139,7 +142,8 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
|||
|
||||
// Draw the items using the new attributes.
|
||||
drawEditGraphics( aPanel->GetClipBox(), aDC, color );
|
||||
drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData, aTransform );
|
||||
drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData,
|
||||
aTransform );
|
||||
|
||||
m_Fill = fillMode;
|
||||
}
|
||||
|
|
|
@ -1091,8 +1091,10 @@ void LIB_PIN::DrawPinTexts( EDA_DRAW_PANEL* panel,
|
|||
if( (Color < 0) && IsSelected() )
|
||||
Color = GetItemSelectedColor();
|
||||
|
||||
NameColor = (EDA_COLOR_T) ( Color == -1 ? ReturnLayerColor( LAYER_PINNAM ) : Color );
|
||||
NumColor = (EDA_COLOR_T) ( Color == -1 ? ReturnLayerColor( LAYER_PINNUM ) : Color );
|
||||
NameColor = (EDA_COLOR_T) ( Color == UNSPECIFIED_COLOR ?
|
||||
ReturnLayerColor( LAYER_PINNAM ) : Color );
|
||||
NumColor = (EDA_COLOR_T) ( Color == UNSPECIFIED_COLOR ?
|
||||
ReturnLayerColor( LAYER_PINNUM ) : Color );
|
||||
|
||||
/* Create the pin num string */
|
||||
ReturnPinStringNum( StringPinNum );
|
||||
|
|
|
@ -75,7 +75,7 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
|
|||
switch( item->Type() )
|
||||
{
|
||||
case LIB_PIN_T:
|
||||
PlacePin( DC );
|
||||
PlacePin();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -89,7 +89,7 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
|
|||
if( no_item_edited )
|
||||
CreatePin( DC );
|
||||
else
|
||||
PlacePin( DC );
|
||||
PlacePin();
|
||||
break;
|
||||
|
||||
case ID_LIBEDIT_BODY_LINE_BUTT:
|
||||
|
|
|
@ -584,7 +584,12 @@ public:
|
|||
*/
|
||||
virtual bool HandleBlockEnd( wxDC* DC );
|
||||
|
||||
void PlacePin( wxDC* DC );
|
||||
/**
|
||||
* Function PlacePin
|
||||
* Place at cursor location the pin currently moved (i.e. pin pointed by m_drawItem)
|
||||
* (and the linked pins, if any)
|
||||
*/
|
||||
void PlacePin();
|
||||
|
||||
/**
|
||||
* Function GlobalSetPins
|
||||
|
|
|
@ -195,7 +195,7 @@ static void AbortPinMove( EDA_DRAW_PANEL* Panel, wxDC* DC )
|
|||
/**
|
||||
* Managed cursor callback for placing component pins.
|
||||
*/
|
||||
void LIB_EDIT_FRAME::PlacePin( wxDC* DC )
|
||||
void LIB_EDIT_FRAME::PlacePin()
|
||||
{
|
||||
LIB_PIN* Pin;
|
||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem;
|
||||
|
@ -268,13 +268,9 @@ another pin. Continue?" ) );
|
|||
Pin->ClearFlags();
|
||||
}
|
||||
|
||||
m_canvas->CrossHairOff( DC );
|
||||
bool showPinText = true;
|
||||
CurrentPin->Draw( m_canvas, DC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR, GR_DEFAULT_DRAWMODE,
|
||||
&showPinText, DefaultTransform );
|
||||
m_canvas->CrossHairOn( DC );
|
||||
|
||||
m_drawItem = NULL;
|
||||
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -286,42 +282,44 @@ another pin. Continue?" ) );
|
|||
*/
|
||||
void LIB_EDIT_FRAME::StartMovePin( wxDC* DC )
|
||||
{
|
||||
LIB_PIN* Pin;
|
||||
LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem;
|
||||
LIB_PIN* currentPin = (LIB_PIN*) m_drawItem;
|
||||
wxPoint startPos;
|
||||
|
||||
TempCopyComponent();
|
||||
|
||||
// Mark pins for moving.
|
||||
Pin = m_component->GetNextPin();
|
||||
LIB_PIN* pin = m_component->GetNextPin();
|
||||
|
||||
for( ; Pin != NULL; Pin = m_component->GetNextPin( Pin ) )
|
||||
for( ; pin != NULL; pin = m_component->GetNextPin( pin ) )
|
||||
{
|
||||
Pin->ClearFlags();
|
||||
pin->ClearFlags();
|
||||
|
||||
if( Pin == CurrentPin )
|
||||
if( pin == currentPin )
|
||||
continue;
|
||||
|
||||
if( ( Pin->GetPosition() == CurrentPin->GetPosition() )
|
||||
&& ( Pin->GetOrientation() == CurrentPin->GetOrientation() )
|
||||
if( ( pin->GetPosition() == currentPin->GetPosition() )
|
||||
&& ( pin->GetOrientation() == currentPin->GetOrientation() )
|
||||
&& SynchronizePins() )
|
||||
Pin->SetFlags( IS_LINKED | IS_MOVED );
|
||||
pin->SetFlags( IS_LINKED | IS_MOVED );
|
||||
}
|
||||
|
||||
CurrentPin->SetFlags( IS_LINKED | IS_MOVED );
|
||||
PinPreviousPos = OldPos = CurrentPin->GetPosition();
|
||||
|
||||
currentPin->SetFlags( IS_LINKED | IS_MOVED );
|
||||
PinPreviousPos = OldPos = currentPin->GetPosition();
|
||||
startPos.x = OldPos.x;
|
||||
startPos.y = -OldPos.y;
|
||||
m_canvas->CrossHairOff( DC );
|
||||
// m_canvas->CrossHairOff( DC );
|
||||
GetScreen()->SetCrossHairPosition( startPos );
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
|
||||
MSG_PANEL_ITEMS items;
|
||||
CurrentPin->GetMsgPanelInfo( items );
|
||||
currentPin->GetMsgPanelInfo( items );
|
||||
SetMsgPanel( items );
|
||||
m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
|
||||
m_canvas->CrossHairOn( DC );
|
||||
// m_canvas->CrossHairOn( DC );
|
||||
|
||||
// Refresh the screen to avoid color artifacts when drawing
|
||||
// the pin in Edit mode and moving it from its start position
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -353,7 +351,8 @@ static void DrawMovePin( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
|
|||
|
||||
// Redraw pin in new position
|
||||
CurrentPin->SetPosition( aPanel->GetScreen()->GetCrossHairPosition( true ) );
|
||||
CurrentPin->Draw( aPanel, aDC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR, g_XorMode, &showPinText, DefaultTransform );
|
||||
CurrentPin->Draw( aPanel, aDC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR, g_XorMode,
|
||||
&showPinText, DefaultTransform );
|
||||
|
||||
PinPreviousPos = CurrentPin->GetPosition();
|
||||
|
||||
|
@ -558,12 +557,13 @@ void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
|
|||
|
||||
wxPoint savepos = GetScreen()->GetCrossHairPosition();
|
||||
m_canvas->CrossHairOff( DC );
|
||||
GetScreen()->SetCrossHairPosition( wxPoint( Pin->GetPosition().x, -Pin->GetPosition().y ) );
|
||||
GetScreen()->SetCrossHairPosition( wxPoint( Pin->GetPosition().x,
|
||||
-Pin->GetPosition().y ) );
|
||||
|
||||
// Add this new pin in list, and creates pins for others parts if needed
|
||||
m_drawItem = Pin;
|
||||
ClearTempCopyComponent();
|
||||
PlacePin( DC );
|
||||
PlacePin();
|
||||
m_lastDrawItem = Pin;
|
||||
|
||||
GetScreen()->SetCrossHairPosition( savepos );
|
||||
|
|
|
@ -44,6 +44,8 @@ class TITLE_BLOCK
|
|||
{
|
||||
public:
|
||||
// TITLE_BLOCK();
|
||||
virtual ~TITLE_BLOCK() {}; // a virtual dtor seems needed to build
|
||||
// python lib without warning
|
||||
|
||||
void SetTitle( const wxString& aTitle ) { m_title = aTitle; }
|
||||
const wxString& GetTitle() const { return m_title; }
|
||||
|
|
|
@ -61,14 +61,7 @@ public:
|
|||
|
||||
PLOTTER( );
|
||||
|
||||
virtual ~PLOTTER()
|
||||
{
|
||||
// Emergency cleanup
|
||||
if( outputFile )
|
||||
{
|
||||
fclose( outputFile );
|
||||
}
|
||||
}
|
||||
virtual ~PLOTTER();
|
||||
|
||||
/**
|
||||
* Returns the effective plot engine in use. It's not very OO but for
|
||||
|
|
|
@ -575,7 +575,7 @@ void CONNECTIONS::Propagate_SubNets()
|
|||
pad->SetSubNet( curr_pad->GetSubNet() );
|
||||
}
|
||||
}
|
||||
else // the track segment is not attached to a cluster
|
||||
else // the current pad is not attached to a cluster
|
||||
{
|
||||
if( pad->GetSubNet() > 0 )
|
||||
{
|
||||
|
@ -599,7 +599,7 @@ void CONNECTIONS::Propagate_SubNets()
|
|||
if( curr_track )
|
||||
curr_track->SetSubNet( sub_netcode );
|
||||
|
||||
// Examine connections between trcaks and pads
|
||||
// Examine connections between tracks and pads
|
||||
for( ; curr_track != NULL; curr_track = curr_track->Next() )
|
||||
{
|
||||
// First: handling connections to pads
|
||||
|
|
Loading…
Reference in New Issue