From c10c6ccdbf4147bc28ea78715be1bba3e26540a8 Mon Sep 17 00:00:00 2001 From: kgv Date: Mon, 18 Jan 2016 12:57:23 +0300 Subject: [PATCH] 0027086: Samples, jniviewer - avoid duplicating viewer redraws --- samples/java/jniviewer/jni/OcctJni_Viewer.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/samples/java/jniviewer/jni/OcctJni_Viewer.cxx b/samples/java/jniviewer/jni/OcctJni_Viewer.cxx index 5098513e1f..e1937b25e6 100644 --- a/samples/java/jniviewer/jni/OcctJni_Viewer.cxx +++ b/samples/java/jniviewer/jni/OcctJni_Viewer.cxx @@ -245,6 +245,7 @@ void OcctJni_Viewer::resize (int theWidth, //myView->MustBeResized(); // can be used instead of SetWindow() when EGLsurface has not been changed EGLContext anEglContext = eglGetCurrentContext(); + myView->SetImmediateUpdate (Standard_False); myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext); //saveSnapshot ("/sdcard/Download/tt.png", theWidth, theHeight); } @@ -554,7 +555,8 @@ void OcctJni_Viewer::fitAll() return; } - myView->FitAll(); + myView->FitAll (0.01, Standard_False); + myView->Invalidate(); } // ======================================================================= @@ -570,6 +572,7 @@ void OcctJni_Viewer::startRotation (int theStartX, } myView->StartRotation (theStartX, theStartY, 0.45); + myView->Invalidate(); } // ======================================================================= @@ -585,6 +588,7 @@ void OcctJni_Viewer::onRotation (int theX, } myView->Rotation (theX, theY); + myView->Invalidate(); } // ======================================================================= @@ -600,6 +604,7 @@ void OcctJni_Viewer::onPanning (int theDX, } myView->Pan (theDX, theDY); + myView->Invalidate(); } // ======================================================================= @@ -615,7 +620,8 @@ void OcctJni_Viewer::onClick (int theX, } myContext->MoveTo (theX, theY, myView, Standard_False); - myContext->Select (Standard_True); + myContext->Select (Standard_False); + myView->Invalidate(); } // =======================================================================