瀏覽代碼

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

Michael Ragazzon 1 月之前
父節點
當前提交
6cf04512c3
共有 1 個文件被更改,包括 3 次插入0 次删除
  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;
 }