From 4262915b38b06521d7328593a135f5385de7451b Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 2 May 2016 15:56:10 +0200 Subject: [PATCH] Code formatting. --- common/draw_panel_gal.cpp | 7 ++++--- common/gal/opengl/opengl_gal.cpp | 15 +++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index f08a518441..512dc98798 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -143,14 +143,15 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) ) return; m_drawing = true; + KIGFX::PCB_RENDER_SETTINGS *settings = static_cast( m_painter->GetSettings() ); m_viewControls->UpdateScrollbars(); m_view->UpdateItems(); m_gal->BeginDrawing(); - m_gal->ClearScreen( m_painter->GetSettings()->GetBackgroundColor() ); + m_gal->ClearScreen( settings->GetBackgroundColor() ); - KIGFX::COLOR4D gridColor = static_cast (m_painter->GetSettings())->GetLayerColor( ITEM_GAL_LAYER ( GRID_VISIBLE ) ); - m_gal->SetGridColor ( gridColor ); + KIGFX::COLOR4D gridColor = settings->GetLayerColor( ITEM_GAL_LAYER( GRID_VISIBLE ) ); + m_gal->SetGridColor( gridColor ); if( m_view->IsDirty() ) { diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index c7a6a5f495..4b6c22d086 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -41,7 +41,7 @@ using namespace KIGFX; static void InitTesselatorCallbacks( GLUtesselator* aTesselator ); -const int glAttributes[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 8, 0 }; +static const int glAttributes[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 8, 0 }; wxGLContext* OPENGL_GAL::glContext = NULL; OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener, @@ -144,8 +144,7 @@ void OPENGL_GAL::BeginDrawing() glViewport( 0, 0, (GLsizei) screenSize.x * scaleFactor, (GLsizei) screenSize.y * scaleFactor ); // Create the screen transformation - glOrtho( 0, (GLint) screenSize.x, 0, (GLsizei) screenSize.y, - -depthRange.x, -depthRange.y ); + glOrtho( 0, (GLint) screenSize.x, 0, (GLsizei) screenSize.y, -depthRange.x, -depthRange.y ); if( !isFramebufferInitialized ) { @@ -298,7 +297,7 @@ void OPENGL_GAL::DrawCircle( const VECTOR2D& aCenterPoint, double aRadius ) currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a ); /* Draw a triangle that contains the circle, then shade it leaving only the circle. - * Parameters given to setShader are indices of the triangle's vertices + * Parameters given to Shader() are indices of the triangle's vertices * (if you want to understand more, check the vertex shader source [shader.vert]). * Shader uses this coordinates to determine if fragments are inside the circle or not. * v2 @@ -311,7 +310,7 @@ void OPENGL_GAL::DrawCircle( const VECTOR2D& aCenterPoint, double aRadius ) aCenterPoint.y - aRadius, layerDepth ); currentManager->Shader( SHADER_FILLED_CIRCLE, 2.0 ); - currentManager->Vertex( aCenterPoint.x + aRadius * sqrt( 3.0f ), // v1 + currentManager->Vertex( aCenterPoint.x + aRadius * sqrt( 3.0f), // v1 aCenterPoint.y - aRadius, layerDepth ); currentManager->Shader( SHADER_FILLED_CIRCLE, 3.0 ); @@ -325,7 +324,7 @@ void OPENGL_GAL::DrawCircle( const VECTOR2D& aCenterPoint, double aRadius ) currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a ); /* Draw a triangle that contains the circle, then shade it leaving only the circle. - * Parameters given to setShader are indices of the triangle's vertices + * Parameters given to Shader() are indices of the triangle's vertices * (if you want to understand more, check the vertex shader source [shader.vert]). * and the line width. Shader uses this coordinates to determine if fragments are * inside the circle or not. @@ -923,7 +922,7 @@ void OPENGL_GAL::drawFilledSemiCircle( const VECTOR2D& aCenterPoint, double aRad currentManager->Rotate( aAngle, 0.0f, 0.0f, 1.0f ); /* Draw a triangle that contains the semicircle, then shade it to leave only - * the semicircle. Parameters given to setShader are indices of the triangle's vertices + * the semicircle. Parameters given to Shader() are indices of the triangle's vertices * (if you want to understand more, check the vertex shader source [shader.vert]). * Shader uses these coordinates to determine if fragments are inside the semicircle or not. * v2 @@ -956,7 +955,7 @@ void OPENGL_GAL::drawStrokedSemiCircle( const VECTOR2D& aCenterPoint, double aRa currentManager->Rotate( aAngle, 0.0f, 0.0f, 1.0f ); /* Draw a triangle that contains the semicircle, then shade it to leave only - * the semicircle. Parameters given to setShader are indices of the triangle's vertices + * the semicircle. Parameters given to Shader() are indices of the triangle's vertices * (if you want to understand more, check the vertex shader source [shader.vert]), the * radius and the line width. Shader uses these coordinates to determine if fragments are * inside the semicircle or not.