update setOrthographic function

This commit is contained in:
wyq 2022-08-11 09:49:46 +08:00
parent 7ee744f212
commit e022ab0191

View File

@ -975,8 +975,14 @@ public class Plot3DGL extends Plot implements GLEventListener {
public void setOrthographic(boolean value) { public void setOrthographic(boolean value) {
this.orthographic = value; this.orthographic = value;
/*if (this.drawable != null) if (this.drawable != null) {
this.updateProjections(this.drawable);*/ this.drawable.invoke(true, new GLRunnable() {
public boolean run(GLAutoDrawable drawable) {
updateProjections(drawable);
return false;
}
});
}
} }
/** /**
@ -4333,6 +4339,7 @@ public class Plot3DGL extends Plot implements GLEventListener {
* Update projections * Update projections
*/ */
public void updateProjections(GLAutoDrawable drawable) { public void updateProjections(GLAutoDrawable drawable) {
//drawable.getContext().makeCurrent();
final GL2 gl = drawable.getGL().getGL2(); final GL2 gl = drawable.getGL().getGL2();
final float h = (float) width / (float) height; final float h = (float) width / (float) height;