From 1e66c5a6d8b6e1836d93a992f6dc3f2004bb899d Mon Sep 17 00:00:00 2001 From: raburton Date: Tue, 5 Jun 2007 15:51:07 +0000 Subject: [PATCH] fix for 3d-display image export (blank box appears in image) --- 3d-viewer/3d_canvas.cpp | 2 +- 3d-viewer/3d_draw.cpp | 3 ++- 3d-viewer/3d_viewer.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/3d-viewer/3d_canvas.cpp b/3d-viewer/3d_canvas.cpp index 1791b11799..8a16b0c439 100644 --- a/3d-viewer/3d_canvas.cpp +++ b/3d-viewer/3d_canvas.cpp @@ -601,7 +601,7 @@ bool fmt_is_jpeg = FALSE; if ( FullFileName.IsEmpty() ) return; } - wxYield(); // Requested to allow tne window redraw after closing the dialog box + Redraw(true); wxSize image_size = GetClientSize(); wxClientDC dc(this); wxBitmap bitmap(image_size.x, image_size.y ); diff --git a/3d-viewer/3d_draw.cpp b/3d-viewer/3d_draw.cpp index 03ef581683..72c7196728 100644 --- a/3d-viewer/3d_draw.cpp +++ b/3d-viewer/3d_draw.cpp @@ -39,7 +39,7 @@ static void Draw3D_FilledSegmentWithHole(double startx, double starty, /**********************************/ -void Pcb3D_GLCanvas::Redraw( void ) +void Pcb3D_GLCanvas::Redraw( bool finish ) /**********************************/ { SetCurrent(); @@ -67,6 +67,7 @@ void Pcb3D_GLCanvas::Redraw( void ) } glFlush(); + if (finish) glFinish(); SwapBuffers(); } diff --git a/3d-viewer/3d_viewer.h b/3d-viewer/3d_viewer.h index e670e5020a..bb0be69b84 100644 --- a/3d-viewer/3d_viewer.h +++ b/3d-viewer/3d_viewer.h @@ -92,7 +92,7 @@ public: void TakeScreenshot(wxCommandEvent & event); void SetView3D(int keycode); void DisplayStatus(void); - void Redraw(void); + void Redraw(bool finish = false); GLuint DisplayCubeforTest(void); void OnEnterWindow( wxMouseEvent& event );