//
// EditorUI::valueFromXPos from 0x4849f0 to 0x484a76 (134 bytes)
//
// 1 xrefs:
// > EditorUI::updateSlider @ 0x484a98
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:49:24 +0000
//
int __fastcall EditorUI::valueFromXPos(LevelEditorLayer **this, float a2)
{
float XMin; // s17
int SectionCount; // r4
float v6; // r0
float v7; // s15
XMin = EditorUI::getXMin((EditorUI *)this, 0);
SectionCount = LevelEditorLayer::getSectionCount(*(this + 236));
v6 = COERCE_FLOAT((*(int (__fastcall **)(_DWORD))(**((_DWORD **)*(this + 236) + 609) + 84))(*((_DWORD *)*(this + 236)
+ 609)));
if ( SectionCount < 100 )
SectionCount = 100;
v7 = (float)-(float)(a2 - XMin) / (float)((float)((float)SectionCount * 100.0) * v6);
if ( v7 <= 0.0 )
{
v7 = 0.0;
}
else if ( v7 >= 1.0 )
{
v7 = 1.0;
}
return LODWORD(v7);
}