Commit c5d3376c authored by Maciej Suminski's avatar Maciej Suminski

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

parent cd568483
......@@ -29,7 +29,6 @@
#include <gal/graphics_abstraction_layer.h>
#include <gal/definitions.h>
using namespace KiGfx;
GAL::GAL() :
......@@ -41,7 +40,7 @@ GAL::GAL() :
SetFillColor( COLOR4D( 0.0, 0.0, 0.0, 0.0 ) );
SetStrokeColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
SetZoomFactor( 1.0 );
SetDepthRange( VECTOR2D( -2048, 2047 ) );
SetDepthRange( VECTOR2D( GAL::MIN_DEPTH, GAL::MAX_DEPTH ) );
SetFlip( false, false );
SetLineWidth( 1.0 );
......@@ -114,7 +113,7 @@ void GAL::DrawGrid()
// Draw the origin marker
double origSize = static_cast<double>( gridOriginMarkerSize ) / worldScale;
SetLayerDepth( 0.0 );
SetLayerDepth( GAL::GRID_DEPTH );
SetIsFill( false );
SetIsStroke( true );
SetStrokeColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) );
......
......@@ -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
// an empty string.
......
......@@ -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();
......
......@@ -818,6 +818,9 @@ public:
depthStack.pop();
}
/// Depth level on which the grid is drawn
static const int GRID_DEPTH = 1024;
protected:
std::stack<double> depthStack; ///< Stored depth values
VECTOR2D screenSize; ///< Screen size in screen coordinates
......@@ -884,6 +887,9 @@ protected:
* @param aCursorSize is the size of the cursor.
*/
virtual void initCursor( int aCursorSize ) = 0;
static const int MIN_DEPTH = -2048;
static const int MAX_DEPTH = 2047;
};
} // namespace KiGfx
......
......@@ -195,7 +195,7 @@ public:
* Returns pointer to current settings that are going to be used when drawing items.
* @return Current rendering settings.
*/
virtual RENDER_SETTINGS* GetSettings()
virtual RENDER_SETTINGS* GetSettings() const
{
return m_settings;
}
......
......@@ -356,7 +356,7 @@ public:
*/
void OnModify();
virtual wxString GetScreenDesc();
virtual wxString GetScreenDesc() const;
void InstallConfigFrame( wxCommandEvent& event );
......
......@@ -499,7 +499,7 @@ public:
EDA_DRAW_PANEL* GetCanvas() { return m_canvas; }
virtual wxString GetScreenDesc();
virtual wxString GetScreenDesc() const;
/**
* Function GetScreen
......
......@@ -63,7 +63,7 @@ public:
m_end = aEnd;
}
void Show( int x, std::ostream& st) const
void Show( int x, std::ostream& st ) const
{
}
......
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