← Back to team overview

kicad-developers team mailing list archive

3d-viewer broken image export patch

 

------=_NextPart_000_5161_755c_48a2 Content-Type: text/plain; format=flowed

Hello,

I see in the latest version there is a fix for the broken 3d-viewer image 
export feature (where you get a blank space in the middle of the image where 
the save as dialog was). Unfortunately it doesn't work, I still get the 
problem. The yield that was added probably reduces the chances of it 
occurring but doesn't prevent it. It hasn't prevented it once on my system, 
but I have had a report from another user that it did on theirs (but they 
didn't always see it on the previous version anyway).

I've had a go at fixing it myself. I'd appreciate your comments because I 
don't know a great deal about wxWidgets/OpenGL. It certainly does the job on 
mine, but then I assume the original fix worked for someone too. Also, is 
this the right place to post patches to get them in upstream?

Richard.
(Debian Kicad package maintainer)

_________________________________________________________________
Txt a lot? Get Messenger FREE on your mobile. 
https://livemessenger.mobile.uk.msn.com/
 ------=_NextPart_000_5161_755c_48a2 Content-Type: text/x-patch; name="screenshot2.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="screenshot2.patch"

diff -Nur kicad-0.0.20070525.orig/3d-viewer/3d_canvas.cpp kicad-0.0.20070525/3d-viewer/3d_canvas.cpp
--- kicad-0.0.20070525.orig/3d-viewer/3d_canvas.cpp	2007-05-28 19:47:34.000000000 +0100
+++ kicad-0.0.20070525/3d-viewer/3d_canvas.cpp	2007-05-28 19:59:04.000000000 +0100
@@ -601,7 +601,7 @@
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 -Nur kicad-0.0.20070525.orig/3d-viewer/3d_draw.cpp kicad-0.0.20070525/3d-viewer/3d_draw.cpp
--- kicad-0.0.20070525.orig/3d-viewer/3d_draw.cpp	2007-05-28 19:47:30.000000000 +0100
+++ kicad-0.0.20070525/3d-viewer/3d_draw.cpp	2007-05-28 20:02:55.000000000 +0100
@@ -39,7 +39,7 @@

/**********************************/
-void Pcb3D_GLCanvas::Redraw( void )
+void Pcb3D_GLCanvas::Redraw( bool finish )
/**********************************/
{
SetCurrent();
@@ -67,6 +67,7 @@
}

glFlush();
+	if (finish) glFinish();
SwapBuffers();
}

diff -Nur kicad-0.0.20070525.orig/3d-viewer/3d_viewer.h kicad-0.0.20070525/3d-viewer/3d_viewer.h
--- kicad-0.0.20070525.orig/3d-viewer/3d_viewer.h	2007-05-28 19:47:02.000000000 +0100
+++ kicad-0.0.20070525/3d-viewer/3d_viewer.h	2007-05-28 19:58:57.000000000 +0100
@@ -92,7 +92,7 @@
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 );

 ------=_NextPart_000_5161_755c_48a2--