Commit c65942e1 authored by charras's avatar charras

eeschema: code cleaning

parent 45a066ab
......@@ -462,8 +462,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
if( CurrentConvert && item->m_Convert && (item->m_Convert != CurrentConvert) )
continue;
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry,
PtBlock->m_MoveVector.x, PtBlock->m_MoveVector.y,
item, CurrentUnit, g_XorMode );
PtBlock->m_MoveVector, item, g_XorMode );
}
}
}
......@@ -491,8 +490,8 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
if( CurrentConvert && item->m_Convert && (item->m_Convert != CurrentConvert) )
continue;
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry,
PtBlock->m_MoveVector.x, PtBlock->m_MoveVector.y,
item, CurrentUnit, g_XorMode );
PtBlock->m_MoveVector,
item, g_XorMode );
}
}
}
......
......@@ -665,3 +665,166 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos, int orient,
}
}
}
/***************************************************************/
LibDrawPin::LibDrawPin() : LibEDA_BaseStruct( COMPONENT_PIN_DRAW_TYPE )
/***************************************************************/
{
m_PinLen = 300; /* default Pin len */
m_Orient = PIN_RIGHT; /* Pin oprient: Up, Down, Left, Right */
m_PinShape = NONE; /* Bit a bit: Pin shape (voir enum prec) */
m_PinType = PIN_UNSPECIFIED; /* electrical type of pin */
m_Attributs = 0; /* bit 0 != 0: pin invisible */
m_PinNum = 0; /*pin number ( i.e. 4 codes Ascii ) */
m_PinNumSize = 50;
m_PinNameSize = 50; /* Default size for pin name and num */
m_Width = 0;
// m_PinNumWidth = m_PinNameWidth = 0; // Unused
}
/******************************************/
wxPoint LibDrawPin::ReturnPinEndPoint()
/******************************************/
/* return the pin end position, for a component in normal orient
*/
{
wxPoint pos = m_Pos;
switch( m_Orient )
{
case PIN_UP:
pos.y += m_PinLen; break;
case PIN_DOWN:
pos.y -= m_PinLen; break;
case PIN_LEFT:
pos.x -= m_PinLen; break;
case PIN_RIGHT:
pos.x += m_PinLen; break;
}
return pos;
}
/********************************************************/
int LibDrawPin::ReturnPinDrawOrient( int TransMat[2][2] )
/********************************************************/
/* Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT),
* according to its orientation,
* AND the matrix transform (rot, mirror) TransMat
*/
{
int orient;
int x1 = 0, y1 = 0;
int t1, t2;
switch( m_Orient )
{
case PIN_UP:
y1 = 1; break;
case PIN_DOWN:
y1 = -1; break;
case PIN_LEFT:
x1 = -1; break;
case PIN_RIGHT:
x1 = 1; break;
}
t1 = TransMat[0][0] * x1 + TransMat[0][1] * y1;
t2 = TransMat[1][0] * x1 + TransMat[1][1] * y1;
orient = PIN_UP;
if( t1 == 0 )
{
if( t2 > 0 )
orient = PIN_DOWN;
}
else
{
orient = PIN_RIGHT;
if( t1 < 0 )
orient = PIN_LEFT;
}
return orient;
}
/****************************************************/
void LibDrawPin::ReturnPinStringNum( wxString& buffer )
/****************************************************/
/* fill the buffer with pin num as a wxString
* Pin num is coded as a long
* Used to print/draw the pin num
*/
{
char ascii_buf[5];
strncpy( ascii_buf, (char*) &m_PinNum, 4 );
ascii_buf[4] = 0;
buffer = CONV_FROM_UTF8( ascii_buf );
}
/****************************************************/
void LibDrawPin::SetPinNumFromString( wxString& buffer )
/****************************************************/
/* fill the buffer with pin num as a wxString
* Pin num is coded as a long
* Used to print/draw the pin num
*/
{
char ascii_buf[4];
unsigned ii, len = buffer.Len();
ascii_buf[0] = ascii_buf[1] = ascii_buf[2] = ascii_buf[3] = 0;
if( len > 4 )
len = 4;
for( ii = 0; ii < len; ii++ )
{
ascii_buf[ii] = buffer.GetChar( ii ) & 0xFF;
}
strncpy( (char*) &m_PinNum, ascii_buf, 4 );
}
/*************************************/
LibDrawPin* LibDrawPin::GenCopy()
/*************************************/
{
LibDrawPin* newpin = new LibDrawPin();
newpin->m_Pos = m_Pos;
newpin->m_PinLen = m_PinLen;
newpin->m_Orient = m_Orient;
newpin->m_PinShape = m_PinShape;
newpin->m_PinType = m_PinType;
newpin->m_Attributs = m_Attributs;
newpin->m_PinNum = m_PinNum;
newpin->m_PinNumSize = m_PinNumSize;
newpin->m_PinNameSize = m_PinNameSize;
newpin->m_Unit = m_Unit;
newpin->m_Convert = m_Convert;
newpin->m_Flags = m_Flags;
newpin->m_Width = m_Width;
newpin->m_PinName = m_PinName;
return newpin;
}
......@@ -15,6 +15,20 @@
//#define DRAW_ARC_WITH_ANGLE // Used to draw arcs
/* Basic class (abstract) for components bodies items */
LibEDA_BaseStruct::LibEDA_BaseStruct( KICAD_T struct_type ) :
EDA_BaseStruct( struct_type )
{
m_Unit = 0; /* Unit identification (for multi part per package)
* 0 if the item is common to all units */
m_Convert = 0; /* Shape identification (for parts which have a convert shape)
* 0 if the item is common to all shapes */
m_Width = 0; /* Default value to draw lines or arc ... */
m_Fill = NO_FILL; /* NO_FILL, FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR.
* has meaning only for some items */
}
/** Function Draw (virtual)
* Draw A body item
* @param aPanel = DrawPanel to use (can be null) mainly used for clipping purposes
......@@ -70,10 +84,14 @@ void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffs
else
#ifdef DRAW_ARC_WITH_ANGLE
GRArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
m_Rayon, LineWidth, color );
#else
GRArc1( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
posc.x, posc.y, LineWidth, color );
#endif
......
......@@ -132,6 +132,7 @@ public:
* 0 if the item is common to all shapes */
wxPoint m_Pos; /* Position or centre (Arc and Circle) or start point (segments) */
int m_Width; /* Tickness */
FILL_T m_Fill; /* NO_FILL, FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR. has meaning only for some items */
public:
LibEDA_BaseStruct* Next()
......@@ -154,7 +155,7 @@ public:
* used for some items to force to force no fill mode
* ( has meaning only for items what can be filled ). used in printing or moving objects mode
* or to pass refernce to the lib component for pins
* @param aTransformMatrix = Transform Matrix
* @param aTransformMatrix = Transform Matrix (rotaion, mirror ..)
*/
virtual void Draw( WinEDA_DrawPanel * aPanel, wxDC * aDC, const wxPoint &aOffset, int aColor,
int aDrawMode, void * aData, int aTransformMatrix[2][2] ) = 0;
......@@ -223,7 +224,6 @@ class LibDrawArc : public LibEDA_BaseStruct
{
public:
int m_Rayon;
FILL_T m_Fill; // NO_FILL, FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR
int t1, t2; /* position des 2 extremites de l'arc en 0.1 degres */
wxPoint m_ArcStart, m_ArcEnd; /* position des 2 extremites de l'arc en coord reelles*/
......@@ -249,7 +249,6 @@ class LibDrawCircle : public LibEDA_BaseStruct
{
public:
int m_Rayon;
FILL_T m_Fill;
public:
LibDrawCircle();
......@@ -304,7 +303,6 @@ class LibDrawSquare : public LibEDA_BaseStruct
{
public:
wxPoint m_End;
FILL_T m_Fill;
public:
LibDrawSquare();
......@@ -352,7 +350,6 @@ class LibDrawPolyline : public LibEDA_BaseStruct
public:
int m_CornersCount;
int* m_PolyList;
FILL_T m_Fill;
public:
LibDrawPolyline();
......@@ -392,7 +389,6 @@ class LibDrawField : public LibEDA_BaseStruct
public:
int m_FieldId; // 0 a 11
// 0 = Name; 1 = Valeur; 2 .. 11 other fields
wxPoint m_Pos;
wxSize m_Size;
int m_Orient; /* Orientation */
int m_Attributs; /* Attributes (Non visible ...) */
......
......@@ -540,7 +540,7 @@ void DeleteOneLibraryDrawStruct( WinEDA_DrawPanel* panel, wxDC* DC,
/* Effacement du graphique */
if( Affiche && DC )
DrawLibraryDrawStruct( panel, DC, LibEntry, 0, 0, DrawItem, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( panel, DC, LibEntry, wxPoint(0, 0), DrawItem, g_XorMode );
/* Effacement de la structure en memoire */
if( LibEntry ) /* Recherche du predecesseur */
......
This diff is collapsed.
......@@ -434,179 +434,6 @@ void LibDrawField::Copy( LibDrawField* Target )
}
/* Elements Graphiques */
LibEDA_BaseStruct::LibEDA_BaseStruct( KICAD_T struct_type ) :
EDA_BaseStruct( struct_type )
{
m_Unit = 0; /* Unit identification (for multi part per package)
* 0 if the item is common to all units */
m_Convert = 0; /* Shape identification (for parts which have a convert shape)
* 0 if the item is common to all shapes */
m_Width = 0; /* Default value to draw lines or arc ... */
}
/***************************************************************/
LibDrawPin::LibDrawPin() : LibEDA_BaseStruct( COMPONENT_PIN_DRAW_TYPE )
/***************************************************************/
{
m_PinLen = 300; /* default Pin len */
m_Orient = PIN_RIGHT; /* Pin oprient: Up, Down, Left, Right */
m_PinShape = NONE; /* Bit a bit: Pin shape (voir enum prec) */
m_PinType = PIN_UNSPECIFIED; /* electrical type of pin */
m_Attributs = 0; /* bit 0 != 0: pin invisible */
m_PinNum = 0; /*pin number ( i.e. 4 codes Ascii ) */
m_PinNumSize = 50;
m_PinNameSize = 50; /* Default size for pin name and num */
m_Width = 0;
// m_PinNumWidth = m_PinNameWidth = 0; // Unused
}
/******************************************/
wxPoint LibDrawPin::ReturnPinEndPoint()
/******************************************/
/* return the pin end position, for a component in normal orient
*/
{
wxPoint pos = m_Pos;
switch( m_Orient )
{
case PIN_UP:
pos.y += m_PinLen; break;
case PIN_DOWN:
pos.y -= m_PinLen; break;
case PIN_LEFT:
pos.x -= m_PinLen; break;
case PIN_RIGHT:
pos.x += m_PinLen; break;
}
return pos;
}
/********************************************************/
int LibDrawPin::ReturnPinDrawOrient( int TransMat[2][2] )
/********************************************************/
/* Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT),
* according to its orientation,
* AND the matrix transform (rot, mirror) TransMat
*/
{
int orient;
int x1 = 0, y1 = 0;
int t1, t2;
switch( m_Orient )
{
case PIN_UP:
y1 = 1; break;
case PIN_DOWN:
y1 = -1; break;
case PIN_LEFT:
x1 = -1; break;
case PIN_RIGHT:
x1 = 1; break;
}
t1 = TransMat[0][0] * x1 + TransMat[0][1] * y1;
t2 = TransMat[1][0] * x1 + TransMat[1][1] * y1;
orient = PIN_UP;
if( t1 == 0 )
{
if( t2 > 0 )
orient = PIN_DOWN;
}
else
{
orient = PIN_RIGHT;
if( t1 < 0 )
orient = PIN_LEFT;
}
return orient;
}
/****************************************************/
void LibDrawPin::ReturnPinStringNum( wxString& buffer )
/****************************************************/
/* fill the buffer with pin num as a wxString
* Pin num is coded as a long
* Used to print/draw the pin num
*/
{
char ascii_buf[5];
strncpy( ascii_buf, (char*) &m_PinNum, 4 );
ascii_buf[4] = 0;
buffer = CONV_FROM_UTF8( ascii_buf );
}
/****************************************************/
void LibDrawPin::SetPinNumFromString( wxString& buffer )
/****************************************************/
/* fill the buffer with pin num as a wxString
* Pin num is coded as a long
* Used to print/draw the pin num
*/
{
char ascii_buf[4];
unsigned ii, len = buffer.Len();
ascii_buf[0] = ascii_buf[1] = ascii_buf[2] = ascii_buf[3] = 0;
if( len > 4 )
len = 4;
for( ii = 0; ii < len; ii++ )
{
ascii_buf[ii] = buffer.GetChar( ii ) & 0xFF;
}
strncpy( (char*) &m_PinNum, ascii_buf, 4 );
}
/*************************************/
LibDrawPin* LibDrawPin::GenCopy()
/*************************************/
{
LibDrawPin* newpin = new LibDrawPin();
newpin->m_Pos = m_Pos;
newpin->m_PinLen = m_PinLen;
newpin->m_Orient = m_Orient;
newpin->m_PinShape = m_PinShape;
newpin->m_PinType = m_PinType;
newpin->m_Attributs = m_Attributs;
newpin->m_PinNum = m_PinNum;
newpin->m_PinNumSize = m_PinNumSize;
newpin->m_PinNameSize = m_PinNameSize;
newpin->m_Unit = m_Unit;
newpin->m_Convert = m_Convert;
newpin->m_Flags = m_Flags;
newpin->m_Width = m_Width;
newpin->m_PinName = m_PinName;
return newpin;
}
/**************************************************************/
LibDrawArc::LibDrawArc() : LibEDA_BaseStruct( COMPONENT_ARC_DRAW_TYPE )
/**************************************************************/
......
......@@ -88,7 +88,7 @@ void WinEDA_PinPropertiesFrame::PinPropertiesAccept( wxCommandEvent& event )
m_Parent->DrawPanel->ManageCurseur( m_Parent->DrawPanel, &dc, FALSE );
else
DrawLibraryDrawStruct( m_Parent->DrawPanel, &dc, CurrentLibEntry,
0, 0, CurrentPin, CurrentUnit, g_XorMode );
wxPoint(0, 0), CurrentPin, g_XorMode );
SetPinName( m_PinNameCtrl->GetValue(), LastPinNameSize );
msg = m_PinNumCtrl->GetValue(); if( msg.IsEmpty() )
......@@ -103,7 +103,7 @@ void WinEDA_PinPropertiesFrame::PinPropertiesAccept( wxCommandEvent& event )
m_Parent->DrawPanel->ManageCurseur( m_Parent->DrawPanel, &dc, FALSE );
else
DrawLibraryDrawStruct( m_Parent->DrawPanel, &dc, CurrentLibEntry,
0, 0, CurrentPin, CurrentUnit, g_XorMode );
wxPoint(0, 0), CurrentPin, g_XorMode );
}
if( CurrentDrawItem )
......@@ -250,7 +250,7 @@ void WinEDA_LibeditFrame::PlacePin( wxDC* DC )
}
DrawPanel->CursorOff( DC );
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, 0, 0, CurrentPin, CurrentUnit,
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0), CurrentPin,
GR_DEFAULT_DRAWMODE );
DrawPanel->CursorOn( DC );
......@@ -344,14 +344,14 @@ static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( erase || (CurrentPin->m_Flags & IS_NEW) )
{
CurrentPin->m_Pos = PinPreviousPos;
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, 0, 0,
CurrentPin, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, wxPoint(0, 0),
CurrentPin, g_XorMode );
}
/* Redraw pin in new position */
CurrentPin->m_Pos.x = panel->GetScreen()->m_Curseur.x;
CurrentPin->m_Pos.y = -panel->GetScreen()->m_Curseur.y;
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, 0, 0, CurrentPin, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, wxPoint(0, 0), CurrentPin, g_XorMode );
PinPreviousPos = CurrentPin->m_Pos;
......@@ -608,7 +608,7 @@ void WinEDA_LibeditFrame::CreatePin( wxDC* DC )
if( DC )
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry,
0, 0, CurrentPin, CurrentUnit, g_XorMode );
wxPoint(0, 0), CurrentPin, g_XorMode );
DrawPanel->m_IgnoreMouseEvents = TRUE;
InstallPineditFrame( this, DC, wxPoint( -1, -1 ) );
......@@ -872,7 +872,7 @@ void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC,
if( selected && (Pin->m_Selected & IS_SELECTED) == 0 )
continue;
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, 0, 0, Pin, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0), Pin, g_XorMode );
switch( id )
{
......@@ -889,8 +889,7 @@ void WinEDA_LibeditFrame::GlobalSetPins( wxDC* DC,
break;
}
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, 0, 0, Pin, CurrentUnit,
GR_DEFAULT_DRAWMODE );
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0), Pin, GR_DEFAULT_DRAWMODE );
}
}
......
......@@ -54,10 +54,10 @@ void DrawLibEntry(WinEDA_DrawPanel * panel, wxDC * DC,
int Multi, int convert,
int DrawMode, int Color = -1);
void DrawLibraryDrawStruct(WinEDA_DrawPanel * panel, wxDC * DC,
EDA_LibComponentStruct *LibEntry, int PartX, int PartY,
LibEDA_BaseStruct *DrawItem, int Multi,
int DrawMode, int Color = -1);
void DrawLibraryDrawStruct(WinEDA_DrawPanel * aPanel, wxDC * aDC,
EDA_LibComponentStruct *aLibEntry, wxPoint aPosition,
LibEDA_BaseStruct *aDrawItem,
int aDrawMode, int aColor = -1);
bool MapAngles(int *Angle1, int *Angle2, int TransMat[2][2]);
......
......@@ -60,8 +60,8 @@ bodygraphics_PropertiesAccept( wxCommandEvent& event )
m_Parent->DrawPanel->PrepareGraphicContext( &dc );
DrawLibraryDrawStruct( m_Parent->DrawPanel, &dc, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( m_Parent->DrawPanel, &dc, CurrentLibEntry, wxPoint(0, 0),
CurrentDrawItem, g_XorMode );
if( g_FlDrawSpecificUnit )
CurrentDrawItem->m_Unit = CurrentUnit;
......@@ -104,8 +104,8 @@ bodygraphics_PropertiesAccept( wxCommandEvent& event )
m_Parent->GetScreen()->SetModify();
DrawLibraryDrawStruct( m_Parent->DrawPanel, &dc, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( m_Parent->DrawPanel, &dc, CurrentLibEntry, wxPoint(0, 0),
CurrentDrawItem, g_XorMode );
}
Close();
......@@ -150,8 +150,8 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC )
Panel->m_Parent->RedrawActiveWindow( DC, TRUE );
}
else
DrawLibraryDrawStruct( Panel, DC, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( Panel, DC, CurrentLibEntry, wxPoint(0, 0),
CurrentDrawItem, g_XorMode );
SAFE_DELETE( CurrentDrawItem );
}
else
......@@ -161,8 +161,8 @@ static void AbortSymbolTraceOn( WinEDA_DrawPanel* Panel, wxDC* DC )
Panel->GetScreen()->m_Curseur = StartCursor;
RedrawWhileMovingCursor( Panel, DC, TRUE );
Panel->GetScreen()->m_Curseur = curpos;
DrawLibraryDrawStruct( Panel, DC, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, GR_DEFAULT_DRAWMODE );
DrawLibraryDrawStruct( Panel, DC, CurrentLibEntry, wxPoint(0, 0),
CurrentDrawItem, GR_DEFAULT_DRAWMODE );
CurrentDrawItem->m_Flags = 0;
}
......@@ -303,8 +303,8 @@ LibEDA_BaseStruct* WinEDA_LibeditFrame::CreateGraphicItem( wxDC* DC )
else
{
StartMoveDrawSymbol( DC );
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, 0, 0,
Text, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0),
Text, g_XorMode );
}
}
break;
......@@ -383,23 +383,20 @@ static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool era
*/
{
BASE_SCREEN* Screen = panel->GetScreen();
int mx, my;
wxPoint pos;
/* Erase shape in the old positon*/
if( erase )
{
mx = ItemPreviousPos.x - StartCursor.x,
my = ItemPreviousPos.y - StartCursor.y;
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, mx, my,
CurrentDrawItem, CurrentUnit, g_XorMode );
pos = ItemPreviousPos - StartCursor,
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, pos,
CurrentDrawItem, g_XorMode );
}
/* Redraw moved shape */
mx = Screen->m_Curseur.x - StartCursor.x,
my = Screen->m_Curseur.y - StartCursor.y;
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, mx, my,
CurrentDrawItem, CurrentUnit, g_XorMode );
pos = Screen->m_Curseur - StartCursor,
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, pos,
CurrentDrawItem, g_XorMode );
ItemPreviousPos = Screen->m_Curseur;
}
......@@ -543,8 +540,8 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
}
else
{
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, DrawMode );
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, wxPoint(0, 0),
CurrentDrawItem, DrawMode );
if( CurrentDrawItem->Type() == COMPONENT_ARC_DRAW_TYPE )
{
int Color = ReturnLayerColor( LAYER_DEVICE );
......@@ -615,8 +612,8 @@ static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
}
else
{
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, DrawMode );
DrawLibraryDrawStruct( panel, DC, CurrentLibEntry, wxPoint(0, 0),
CurrentDrawItem, DrawMode );
if( CurrentDrawItem->Type() == COMPONENT_ARC_DRAW_TYPE )
{
int Color = ReturnLayerColor( LAYER_DEVICE );
......@@ -824,8 +821,8 @@ void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC )
int* ptpoly;
LibDrawPolyline* Poly = (LibDrawPolyline*) CurrentDrawItem;
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0),
CurrentDrawItem, g_XorMode );
while( Poly->m_CornersCount > 2 ) // First segment is kept, only its end point is changed
{
......@@ -843,6 +840,6 @@ void WinEDA_LibeditFrame::DeleteDrawPoly( wxDC* DC )
int allocsize = 2 * sizeof(int) * Poly->m_CornersCount;
Poly->m_PolyList = (int*) realloc( Poly->m_PolyList, allocsize );
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, 0, 0,
CurrentDrawItem, CurrentUnit, g_XorMode );
DrawLibraryDrawStruct( DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0),
CurrentDrawItem, g_XorMode );
}
......@@ -291,8 +291,8 @@ int DrawMode = g_XorMode;
/* Effacement ancien texte */
if( ((LibDrawText*)DrawItem)->m_Text && DC)
DrawLibraryDrawStruct(DrawPanel, DC, CurrentLibEntry, 0 , 0,
DrawItem, CurrentUnit, DrawMode);
DrawLibraryDrawStruct(DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0),
DrawItem, DrawMode);
WinEDA_bodytext_PropertiesFrame * frame =
......@@ -306,8 +306,8 @@ int DrawMode = g_XorMode;
{
if ( (DrawItem->m_Flags & IS_MOVED) == 0 )
DrawMode = GR_DEFAULT_DRAWMODE;
DrawLibraryDrawStruct(DrawPanel, DC, CurrentLibEntry, 0 , 0,
DrawItem, CurrentUnit, DrawMode);
DrawLibraryDrawStruct(DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0),
DrawItem, DrawMode);
}
}
......@@ -325,8 +325,8 @@ LibDrawText * DrawItem = (LibDrawText *) CurrentDrawItem;
/* Erase drawing (can be within a move command) */
if ( DrawPanel->ManageCurseur == NULL)
DrawLibraryDrawStruct(DrawPanel, DC, CurrentLibEntry, 0 , 0,
DrawItem, CurrentUnit, g_XorMode);
DrawLibraryDrawStruct(DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0),
DrawItem, g_XorMode);
else DrawPanel->ManageCurseur(DrawPanel, DC, FALSE);
if( DrawItem->m_Horiz == TEXT_ORIENT_HORIZ)
......@@ -337,8 +337,8 @@ LibDrawText * DrawItem = (LibDrawText *) CurrentDrawItem;
/* Redraw item with new orient */
if ( DrawPanel->ManageCurseur == NULL)
DrawLibraryDrawStruct(DrawPanel, DC, CurrentLibEntry, 0 , 0,
DrawItem, CurrentUnit, GR_DEFAULT_DRAWMODE);
DrawLibraryDrawStruct(DrawPanel, DC, CurrentLibEntry, wxPoint(0, 0),
DrawItem, GR_DEFAULT_DRAWMODE);
else DrawPanel->ManageCurseur(DrawPanel, DC, FALSE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment