|
|
@@ -50,9 +50,7 @@ ElementImage::~ElementImage() {}
|
|
|
|
|
|
bool ElementImage::GetIntrinsicDimensions(Vector2f& _dimensions, float& _ratio)
|
|
|
{
|
|
|
- // Check if we need to reload the texture.
|
|
|
- if (texture_dirty)
|
|
|
- LoadTexture();
|
|
|
+ EnsureSourceLoaded();
|
|
|
|
|
|
// Calculate the x dimension.
|
|
|
if (HasAttribute("width"))
|
|
|
@@ -79,6 +77,11 @@ bool ElementImage::GetIntrinsicDimensions(Vector2f& _dimensions, float& _ratio)
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
+void ElementImage::EnsureSourceLoaded()
|
|
|
+{
|
|
|
+ if (texture_dirty)
|
|
|
+ LoadTexture();
|
|
|
+}
|
|
|
|
|
|
void ElementImage::OnRender()
|
|
|
{
|