Code formatting.
This commit is contained in:
parent
0cfa360390
commit
4262915b38
|
@ -143,14 +143,15 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_drawing = true;
|
m_drawing = true;
|
||||||
|
KIGFX::PCB_RENDER_SETTINGS *settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_painter->GetSettings() );
|
||||||
|
|
||||||
m_viewControls->UpdateScrollbars();
|
m_viewControls->UpdateScrollbars();
|
||||||
m_view->UpdateItems();
|
m_view->UpdateItems();
|
||||||
m_gal->BeginDrawing();
|
m_gal->BeginDrawing();
|
||||||
m_gal->ClearScreen( m_painter->GetSettings()->GetBackgroundColor() );
|
m_gal->ClearScreen( settings->GetBackgroundColor() );
|
||||||
|
|
||||||
KIGFX::COLOR4D gridColor = static_cast<KIGFX::PCB_RENDER_SETTINGS*> (m_painter->GetSettings())->GetLayerColor( ITEM_GAL_LAYER ( GRID_VISIBLE ) );
|
KIGFX::COLOR4D gridColor = settings->GetLayerColor( ITEM_GAL_LAYER( GRID_VISIBLE ) );
|
||||||
m_gal->SetGridColor ( gridColor );
|
m_gal->SetGridColor( gridColor );
|
||||||
|
|
||||||
if( m_view->IsDirty() )
|
if( m_view->IsDirty() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
using namespace KIGFX;
|
using namespace KIGFX;
|
||||||
|
|
||||||
static void InitTesselatorCallbacks( GLUtesselator* aTesselator );
|
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;
|
wxGLContext* OPENGL_GAL::glContext = NULL;
|
||||||
|
|
||||||
OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
|
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 );
|
glViewport( 0, 0, (GLsizei) screenSize.x * scaleFactor, (GLsizei) screenSize.y * scaleFactor );
|
||||||
|
|
||||||
// Create the screen transformation
|
// Create the screen transformation
|
||||||
glOrtho( 0, (GLint) screenSize.x, 0, (GLsizei) screenSize.y,
|
glOrtho( 0, (GLint) screenSize.x, 0, (GLsizei) screenSize.y, -depthRange.x, -depthRange.y );
|
||||||
-depthRange.x, -depthRange.y );
|
|
||||||
|
|
||||||
if( !isFramebufferInitialized )
|
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 );
|
currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a );
|
||||||
|
|
||||||
/* Draw a triangle that contains the circle, then shade it leaving only the circle.
|
/* 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]).
|
* (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.
|
* Shader uses this coordinates to determine if fragments are inside the circle or not.
|
||||||
* v2
|
* v2
|
||||||
|
@ -311,7 +310,7 @@ void OPENGL_GAL::DrawCircle( const VECTOR2D& aCenterPoint, double aRadius )
|
||||||
aCenterPoint.y - aRadius, layerDepth );
|
aCenterPoint.y - aRadius, layerDepth );
|
||||||
|
|
||||||
currentManager->Shader( SHADER_FILLED_CIRCLE, 2.0 );
|
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 );
|
aCenterPoint.y - aRadius, layerDepth );
|
||||||
|
|
||||||
currentManager->Shader( SHADER_FILLED_CIRCLE, 3.0 );
|
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 );
|
currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a );
|
||||||
|
|
||||||
/* Draw a triangle that contains the circle, then shade it leaving only the circle.
|
/* 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]).
|
* (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
|
* and the line width. Shader uses this coordinates to determine if fragments are
|
||||||
* inside the circle or not.
|
* 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 );
|
currentManager->Rotate( aAngle, 0.0f, 0.0f, 1.0f );
|
||||||
|
|
||||||
/* Draw a triangle that contains the semicircle, then shade it to leave only
|
/* 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]).
|
* (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.
|
* Shader uses these coordinates to determine if fragments are inside the semicircle or not.
|
||||||
* v2
|
* v2
|
||||||
|
@ -956,7 +955,7 @@ void OPENGL_GAL::drawStrokedSemiCircle( const VECTOR2D& aCenterPoint, double aRa
|
||||||
currentManager->Rotate( aAngle, 0.0f, 0.0f, 1.0f );
|
currentManager->Rotate( aAngle, 0.0f, 0.0f, 1.0f );
|
||||||
|
|
||||||
/* Draw a triangle that contains the semicircle, then shade it to leave only
|
/* 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
|
* (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
|
* radius and the line width. Shader uses these coordinates to determine if fragments are
|
||||||
* inside the semicircle or not.
|
* inside the semicircle or not.
|
||||||
|
|
Loading…
Reference in New Issue