|
|
@@ -54,6 +54,14 @@ bool ElementSVG::GetIntrinsicDimensions(Vector2f& dimensions, float& ratio)
|
|
|
LoadSource();
|
|
|
|
|
|
dimensions = intrinsic_dimensions;
|
|
|
+
|
|
|
+ if (HasAttribute("width")) {
|
|
|
+ dimensions.x = GetAttribute< float >("width", -1);
|
|
|
+ }
|
|
|
+ if (HasAttribute("height")) {
|
|
|
+ dimensions.y = GetAttribute< float >("height", -1);
|
|
|
+ }
|
|
|
+
|
|
|
if (dimensions.y > 0)
|
|
|
ratio = dimensions.x / dimensions.y;
|
|
|
|
|
|
@@ -87,6 +95,12 @@ void ElementSVG::OnAttributeChange(const ElementAttributes& changed_attributes)
|
|
|
source_dirty = true;
|
|
|
DirtyLayout();
|
|
|
}
|
|
|
+
|
|
|
+ if (changed_attributes.find("width") != changed_attributes.end() ||
|
|
|
+ changed_attributes.find("height") != changed_attributes.end())
|
|
|
+ {
|
|
|
+ DirtyLayout();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void ElementSVG::OnPropertyChange(const PropertyIdSet& changed_properties)
|