Commit 39497b10 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Pcbnew: fix Bug #1422093 (pcbnew crashes after editing a footprint cominng...

Pcbnew: fix  Bug #1422093 (pcbnew crashes after editing a footprint cominng from the board  with the fp editor and saving it on a librray and trying to load it to the board)
Some other very minor fixes.
parent dcdaee4c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -84,7 +84,6 @@ void S3D_MASTER::ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices )
        }

        /* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
#define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB)
        aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV;
        aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV;
        aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV;
+8 −0
Original line number Diff line number Diff line
@@ -42,6 +42,14 @@
 */
#define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100)

/**
 * scaling factor for 3D shape offset ( S3D_MASTER::m_MatPosition member )
 * Was in inches in legacy version, and, due to a mistake, still in inches
 * in .kicad_pcb files (which are using mm)
 * so this scaling convert file units (inch) to 3D units (0.1 inch), only
 * for S3D_MASTER::m_MatPosition parameter
 */
#define SCALE_3D_CONV 10

class S3D_MASTER;
class STRUCT_3D_SHAPE;
+0 −3
Original line number Diff line number Diff line
@@ -75,9 +75,6 @@ void VRML1_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
    glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
            GetMaster()->m_MatPosition.z );


#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB )

    // glPushMatrix();
    glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );

+0 −4
Original line number Diff line number Diff line
@@ -79,10 +79,6 @@ void X3D_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3Du
    glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
            GetMaster()->m_MatPosition.z );


#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB )


    glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );

    glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f );
+1 −3
Original line number Diff line number Diff line
@@ -489,9 +489,7 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
    DPOINT  pos_dev = userToDeviceCoordinates( pos );

    int     delta   = KiROUND( penDiameter - penOverlap );
    int     radius  = diametre / 2;

    radius = ( diametre - KiROUND( penDiameter ) ) / 2;
    int     radius  = ( diametre - KiROUND( penDiameter ) ) / 2;

    if( radius < 0 )
        radius = 0;
Loading