Commit c5d3376c authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Changed some 'magic numbers' into constants. Added const modifier in appropriate spots.

parent cd568483
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -29,7 +29,6 @@
#include <gal/graphics_abstraction_layer.h>
#include <gal/graphics_abstraction_layer.h>
#include <gal/definitions.h>
#include <gal/definitions.h>



using namespace KiGfx;
using namespace KiGfx;


GAL::GAL() :
GAL::GAL() :
@@ -41,7 +40,7 @@ GAL::GAL() :
    SetFillColor( COLOR4D( 0.0, 0.0, 0.0, 0.0 ) );
    SetFillColor( COLOR4D( 0.0, 0.0, 0.0, 0.0 ) );
    SetStrokeColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
    SetStrokeColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
    SetZoomFactor( 1.0 );
    SetZoomFactor( 1.0 );
    SetDepthRange( VECTOR2D( -2048, 2047 ) );
    SetDepthRange( VECTOR2D( GAL::MIN_DEPTH, GAL::MAX_DEPTH ) );
    SetFlip( false, false );
    SetFlip( false, false );
    SetLineWidth( 1.0 );
    SetLineWidth( 1.0 );


@@ -114,7 +113,7 @@ void GAL::DrawGrid()


    // Draw the origin marker
    // Draw the origin marker
    double origSize = static_cast<double>( gridOriginMarkerSize ) / worldScale;
    double origSize = static_cast<double>( gridOriginMarkerSize ) / worldScale;
    SetLayerDepth( 0.0 );
    SetLayerDepth( GAL::GRID_DEPTH );
    SetIsFill( false );
    SetIsFill( false );
    SetIsStroke( true );
    SetIsStroke( true );
    SetStrokeColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
    SetStrokeColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
+1 −1
Original line number Original line Diff line number Diff line
@@ -101,7 +101,7 @@ void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWi
}
}




wxString EDA_DRAW_FRAME::GetScreenDesc()
wxString EDA_DRAW_FRAME::GetScreenDesc() const
{
{
    // Virtual function. In basic class, returns
    // Virtual function. In basic class, returns
    // an empty string.
    // an empty string.
+1 −1
Original line number Original line Diff line number Diff line
@@ -324,7 +324,7 @@ SCH_SCREEN* SCH_EDIT_FRAME::GetScreen() const
}
}




wxString SCH_EDIT_FRAME::GetScreenDesc()
wxString SCH_EDIT_FRAME::GetScreenDesc() const
{
{
    wxString s = m_CurrentSheet->PathHumanReadable();
    wxString s = m_CurrentSheet->PathHumanReadable();


+6 −0
Original line number Original line Diff line number Diff line
@@ -818,6 +818,9 @@ public:
        depthStack.pop();
        depthStack.pop();
    }
    }


    /// Depth level on which the grid is drawn
    static const int GRID_DEPTH = 1024;

protected:
protected:
    std::stack<double> depthStack;             ///< Stored depth values
    std::stack<double> depthStack;             ///< Stored depth values
    VECTOR2D           screenSize;             ///< Screen size in screen coordinates
    VECTOR2D           screenSize;             ///< Screen size in screen coordinates
@@ -884,6 +887,9 @@ protected:
     * @param aCursorSize is the size of the cursor.
     * @param aCursorSize is the size of the cursor.
     */
     */
    virtual void initCursor( int aCursorSize ) = 0;
    virtual void initCursor( int aCursorSize ) = 0;

    static const int MIN_DEPTH = -2048;
    static const int MAX_DEPTH = 2047;
};
};
} // namespace KiGfx
} // namespace KiGfx


+1 −1
Original line number Original line Diff line number Diff line
@@ -195,7 +195,7 @@ public:
     * Returns pointer to current settings that are going to be used when drawing items.
     * Returns pointer to current settings that are going to be used when drawing items.
     * @return Current rendering settings.
     * @return Current rendering settings.
     */
     */
    virtual RENDER_SETTINGS* GetSettings()
    virtual RENDER_SETTINGS* GetSettings() const
    {
    {
        return m_settings;
        return m_settings;
    }
    }
Loading