Container can how set a pipeline that overrides all children

This commit is contained in:
Richard Davey 2020-10-29 17:22:16 +00:00
parent ce69c22e86
commit bf7e7f352a

View file

@ -22,8 +22,9 @@
var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix)
{ {
var children = container.list; var children = container.list;
var childCount = children.length;
if (children.length === 0) if (childCount === 0)
{ {
return; return;
} }
@ -51,14 +52,16 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix
renderer.setBlendMode(0); renderer.setBlendMode(0);
} }
if (container.forcePipeline)
{
renderer.pipelines.lock(container.pipeline, container);
}
var alpha = container.alpha; var alpha = container.alpha;
var scrollFactorX = container.scrollFactorX; var scrollFactorX = container.scrollFactorX;
var scrollFactorY = container.scrollFactorY; var scrollFactorY = container.scrollFactorY;
var list = children;
var childCount = children.length;
for (var i = 0; i < childCount; i++) for (var i = 0; i < childCount; i++)
{ {
var child = children[i]; var child = children[i];
@ -114,7 +117,7 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix
renderer.currentType = type; renderer.currentType = type;
} }
renderer.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === renderer.currentType) : false; renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false;
// Set parent values // Set parent values
child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);
@ -137,6 +140,11 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix
renderer.newType = false; renderer.newType = false;
} }
if (container.forcePipeline)
{
renderer.pipelines.unlock();
}
}; };
module.exports = ContainerWebGLRenderer; module.exports = ContainerWebGLRenderer;