Skip to content

Commit d70f8c8

Browse files
committed
1.6: Bump LunaSVG from 3.2.0 to [0dd60d1](sammycage/lunasvg@0dd60d1) - PR #4615
See [releases for LunaSVG](https://github.com/sammycage/lunasvg/releases) for changes in previous versions. Testing resource with presets/test cases: [svg.zip](https://github.com/user-attachments/files/24606373/svg.zip) Additional PR for custom font support #4620
1 parent 51d01e1 commit d70f8c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2495
-785
lines changed

Client/mods/deathmatch/logic/CClientVectorGraphic.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ bool CClientVectorGraphic::SetDocument(CXMLNode* node)
5454
m_pXMLDocument = node;
5555
m_pSVGDocument = lunasvg::Document::loadFromData(node->ToString());
5656

57+
// Check if LunaSVG successfully parsed the document
58+
if (!m_pSVGDocument)
59+
return false;
60+
5761
m_pVectorGraphicDisplay->Update();
5862

5963
return true;

Client/mods/deathmatch/logic/CClientVectorGraphicDisplay.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ void CClientVectorGraphicDisplay::UpdateTexture()
9292
if (!surface)
9393
return;
9494

95+
// Check for valid SVG dimensions to avoid division by zero
96+
if (svgDocument->width() <= 0 || svgDocument->height() <= 0)
97+
return;
98+
9599
// SVG has a predefined width and height. We need transform it to the requested size
96100
const Matrix transformationMatrix(pVectorGraphicItem->m_uiSizeX / svgDocument->width(), 0, 0, pVectorGraphicItem->m_uiSizeY / svgDocument->height(), 0, 0);
97101

0 commit comments

Comments
 (0)