diff options
author | Kevin Rushforth <[email protected]> | 2008-01-31 21:02:30 +0000 |
---|---|---|
committer | Kevin Rushforth <[email protected]> | 2008-01-31 21:02:30 +0000 |
commit | 27c935acb4af14c4b20515f4ec9ee9bdd751239a (patch) | |
tree | 1289e5de09c3b45a93bab8eb986ba1067c357893 | |
parent | 64682cacf30bf24c318777dbba9f1d0671bff976 (diff) |
Fixed issue 562: Error occurs when Canvas3D removed from View
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@886 ba19aa83-45c5-6ac9-afd3-db810772062c
-rw-r--r-- | src/classes/share/javax/media/j3d/RenderBin.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/classes/share/javax/media/j3d/RenderBin.java b/src/classes/share/javax/media/j3d/RenderBin.java index bb17ac8..6724fda 100644 --- a/src/classes/share/javax/media/j3d/RenderBin.java +++ b/src/classes/share/javax/media/j3d/RenderBin.java @@ -5820,12 +5820,18 @@ System.err.println("......tb.soleUser= " + // dirtyOrientedShapes void updateOrientedRAs() { int i, nRAs; - Canvas3D cv; + Canvas3D cv = null; RenderAtom ra; OrientedShape3DRetained os; - cv = (Canvas3D)view.getCanvas3D(0); - if (view.viewCache.vcDirtyMask != 0) { + // Issue 562 : use cached list of canvases to avoid index OOB exception + Canvas3D[] canvases = view.getCanvases(); + if (canvases.length > 0) { + cv = canvases[0]; + } + + if (cv != null) { + if (view.viewCache.vcDirtyMask != 0) { nRAs = orientedRAs.size(); // Update ra's localToVworld given orientedTransform @@ -5846,7 +5852,7 @@ System.err.println("......tb.soleUser= " + } ra.updateOrientedTransform(); } - } else { + } else { nRAs = cachedDirtyOrientedRAs.size(); // Update ra's localToVworld given orientedTransform // Mark Oriented shape as dirty, since multiple ra could point @@ -5867,6 +5873,7 @@ System.err.println("......tb.soleUser= " + } ra.updateOrientedTransform(); } + } } cachedDirtyOrientedRAs.clear(); |