fix layout designer

This commit is contained in:
2019-09-26 17:48:38 +02:00
parent e406f7964c
commit 8b179260fb
9 changed files with 27 additions and 11 deletions

View File

@@ -152,7 +152,7 @@ void NodeImage::load_url(const std::string& url)
m_remote_texture->create_mipmaps();
delete rgba;
if (m_autosize)
SetAspectRatio(w / h);
SetAspectRatio((float)w / (float)h);
}
m_remote_asset.reset();
}
@@ -162,6 +162,6 @@ void NodeImage::load_url(const std::string& url)
void NodeImage::added(Node* parent)
{
Node::added(parent);
if (!m_url.empty() && root() == App::I->layout.get(App::I->main_id))
if (!m_url.empty() && added_to_root())
load_url(m_url);
}