RenderableWebEntityItem root item check moved to hasWebSurface and buildWebSurface

This commit is contained in:
Cristian Luis Duarte 2018-03-19 15:33:14 -03:00
parent ee6c65c1ac
commit 17fddd9e0e

View file

@ -174,9 +174,7 @@ void WebEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene
}
if (urlChanged) {
if (_webSurface->getRootItem()) {
_webSurface->getRootItem()->setProperty("url", _lastSourceUrl);
}
_webSurface->getRootItem()->setProperty("url", _lastSourceUrl);
}
if (_contextPosition != entity->getWorldPosition()) {
@ -241,7 +239,7 @@ void WebEntityRenderer::doRender(RenderArgs* args) {
}
bool WebEntityRenderer::hasWebSurface() {
return (bool)_webSurface;
return (bool)_webSurface && _webSurface->getRootItem();
}
bool WebEntityRenderer::buildWebSurface(const TypedEntityPointer& entity) {
@ -305,7 +303,7 @@ bool WebEntityRenderer::buildWebSurface(const TypedEntityPointer& entity) {
_fadeStartTime = usecTimestampNow();
_webSurface->resume();
return true;
return _webSurface->getRootItem();
}
void WebEntityRenderer::destroyWebSurface() {