Decompile 2 functions in Source/UI/Layout/SnapMgr.cpp

Batch #16272 by Yommy: 2 byte-identical, 0 confirmed by peer review.

- fn_09706 CSnapMgr::ConstrainGroup: byte-identical
- fn_09715 CSnapMgr::ConnectedToRoot: byte-identical (already on main)

Merged automatically: every function is byte-identical to the original.
This commit is contained in:
ragnarok-clanker 2026-11-10 15:50:40 +00:00
commit 8f922eff50

View file

@ -4,6 +4,8 @@
#include "Render/Renderer.h"
#include "UI/Window/UIWindowMgr.h"
#include <cstdlib>
// STATIC: 0x01334698
// GLOBAL: gl_21916
const int g_snapOppositeSide[4] = {2, 3, 0, 1};
@ -16,13 +18,6 @@ int g_snapDirection = 1;
// GLOBAL: gl_24655
CSnapMgr g_snapMgr;
namespace {
// INLINED
int Magnitude(int value) {
return value < 0 ? (0 - value) : value;
}
}
// OFFSET: 0x007E2DB0
// FUNCTION: fn_09714
bool SnapObject::ContainsUpward(SnapObject* target) {
@ -63,8 +58,8 @@ SnapObject* CSnapMgr::Find(const UIWindow* window) const {
// INLINED
void CSnapMgr::ResetVisited() {
for (SnapObject* object : this->objects) {
object->visited = 0;
for (auto object = this->objects.begin(); object != this->objects.end(); ++object) {
(*object)->visited = 0;
}
}
@ -210,11 +205,11 @@ void CSnapMgr::ConstrainGroup(UIWindow* window, int& dx, int& dy) {
g_windowMgr.ConstrainSnap(member, x, y, 1);
member->geometry.x = savedY;
if (Magnitude(resultX) < Magnitude(x)) {
if (std::abs(resultX) < std::abs(x)) {
resultX = x;
}
if (Magnitude(resultY) < Magnitude(y)) {
if (std::abs(resultY) < std::abs(y)) {
resultY = y;
}
}