Browse Source

Scale intrinsic dimensions of SVG element by dp-ratio, see #854

Michael Ragazzon 1 month ago
parent
commit
6cf04512c3
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Source/SVG/ElementSVG.cpp

+ 3 - 0
Source/SVG/ElementSVG.cpp

@@ -27,6 +27,7 @@
  */
 
 #include "../../Include/RmlUi/SVG/ElementSVG.h"
+#include "../../Include/RmlUi/Core/ElementUtilities.h"
 #include "../../Include/RmlUi/Core/Geometry.h"
 #include "../../Include/RmlUi/Core/PropertyIdSet.h"
 #include "SVGCache.h"
@@ -58,6 +59,8 @@ bool ElementSVG::GetIntrinsicDimensions(Vector2f& dimensions, float& ratio)
 	if (dimensions.y > 0)
 		ratio = dimensions.x / dimensions.y;
 
+	dimensions *= ElementUtilities::GetDensityIndependentPixelRatio(this);
+
 	return true;
 }