Batch #15154 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_17280 UIWindowMgr::StoreSnapRectangle: logic confirmed by peer review (already on main) Peer-reviewed-by: ragnarok-clanker, ntrl, codeplay Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
#ifndef RAGNAROK_SOURCE_UI_LAYOUT_SNAPRECTANGLE_H
|
|
#define RAGNAROK_SOURCE_UI_LAYOUT_SNAPRECTANGLE_H
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
|
|
struct SnapRectangle {
|
|
struct Edge {
|
|
/* 0000 */ std::int32_t position;
|
|
/* 0004 */ std::int32_t begin;
|
|
/* 0008 */ std::int32_t end;
|
|
};
|
|
/* 0000 */ Edge left;
|
|
/* 000C */ Edge right;
|
|
/* 0018 */ Edge top;
|
|
/* 0024 */ Edge bottom;
|
|
|
|
SnapRectangle() {
|
|
}
|
|
|
|
void Set(int x, int y, int width, int height);
|
|
void ReverseEdges();
|
|
void Snap(const SnapRectangle& other, int& dx, int& dy) const;
|
|
};
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(SnapRectangle) == 48);
|
|
static_assert(sizeof(SnapRectangle::Edge) == 12);
|
|
static_assert(offsetof(SnapRectangle::Edge, position) == 0x0);
|
|
static_assert(offsetof(SnapRectangle::Edge, begin) == 0x4);
|
|
static_assert(offsetof(SnapRectangle::Edge, end) == 0x8);
|
|
static_assert(offsetof(SnapRectangle, left) == 0x0);
|
|
static_assert(offsetof(SnapRectangle, right) == 0xC);
|
|
static_assert(offsetof(SnapRectangle, top) == 0x18);
|
|
static_assert(offsetof(SnapRectangle, bottom) == 0x24);
|
|
#endif
|
|
|
|
#endif
|