aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-06-30 11:59:54 -0700
committerHarvey Harrison <[email protected]>2013-06-30 22:50:41 -0700
commit91a1754cae120129469c201023901185bc4526e7 (patch)
tree92b2e805d853524b86ab29f6e6d14518b0d43603
parent04e6a1b9b47f9a3eaa3573c2cbe4c2cf403f7a28 (diff)
j3dcore: unconditionally resize the offscreen layer if required when setting the Viewport
This ensures that the offscreen layer is appropriately sized even on the initial display, some users reported incorrect canvas size until something caused the layout to change. Signed-off-by: Harvey Harrison <[email protected]>
-rw-r--r--src/classes/share/javax/media/j3d/Canvas3D.java1
-rw-r--r--src/classes/share/javax/media/j3d/Renderer.java1
2 files changed, 1 insertions, 1 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java
index 5bafee1..ab9f0a3 100644
--- a/src/classes/share/javax/media/j3d/Canvas3D.java
+++ b/src/classes/share/javax/media/j3d/Canvas3D.java
@@ -4870,6 +4870,7 @@ boolean isAntialiasingSet() {
// The native method for setting the Viewport.
void setViewport(Context ctx, int x, int y, int width, int height) {
+ Pipeline.getPipeline().resizeOffscreenLayer(this, width, height);
Pipeline.getPipeline().setViewport(ctx, x, y, width, height);
}
diff --git a/src/classes/share/javax/media/j3d/Renderer.java b/src/classes/share/javax/media/j3d/Renderer.java
index e39d6da..ed393e3 100644
--- a/src/classes/share/javax/media/j3d/Renderer.java
+++ b/src/classes/share/javax/media/j3d/Renderer.java
@@ -987,7 +987,6 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
int cvWidth = cvCache.getCanvasWidth();
int cvHeight = cvCache.getCanvasHeight();
- Pipeline.getPipeline().resizeOffscreenLayer(canvas, cvWidth, cvHeight);
// setup viewport
canvas.setViewport(canvas.ctx, 0, 0, cvWidth, cvHeight);