Skip to content

Commit

Permalink
Fixed misplaced text on radio buttons in COP (#382)
Browse files Browse the repository at this point in the history
This commit reimplements fix from
d58bf5b
  • Loading branch information
Xottab-DUTY committed Feb 10, 2024
1 parent c1b2973 commit ba154b8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/xrUICore/XML/UIXmlInitBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,12 @@ bool CUIXmlInitBase::InitText(CUIXml& xml_doc, LPCSTR path, int index, CUILines*
pLines->SetTextComplexMode(xml_doc.ReadAttribInt(path, index, "complex_mode", 0) ? true : false);

// Text coordinates
const float text_x = xml_doc.ReadAttribFlt(path, index, "x", 0.0f);
const float text_y = xml_doc.ReadAttribFlt(path, index, "y", 0.0f);
// m_TextOffset can be already set during parent element creation (e.g. 3tButton)
// so reuse it as default.
const float text_x = xml_doc.ReadAttribFlt(path, index, "x", pLines->m_TextOffset.x);
const float text_y = xml_doc.ReadAttribFlt(path, index, "y", pLines->m_TextOffset.y);

pLines->m_TextOffset.add({ text_x, text_y });
pLines->m_TextOffset = { text_x, text_y };

shared_str text = xml_doc.Read(path, index, NULL);
if (text.size())
Expand Down

0 comments on commit ba154b8

Please sign in to comment.