Add XCUI core scroll view validation in new_editor
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
#include <XCEngine/UI/Runtime/UIScreenTypes.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace UI {
|
||||
namespace Runtime {
|
||||
@@ -18,10 +22,31 @@ public:
|
||||
|
||||
class UIDocumentScreenHost final : public IUIScreenDocumentHost {
|
||||
public:
|
||||
struct ScrollDebugSnapshot {
|
||||
std::uint64_t totalWheelEventCount = 0u;
|
||||
std::uint64_t handledWheelEventCount = 0u;
|
||||
UIPoint lastPointerPosition = {};
|
||||
UIRect lastViewportRect = {};
|
||||
UIRect primaryViewportRect = {};
|
||||
float lastWheelDelta = 0.0f;
|
||||
float lastOverflow = 0.0f;
|
||||
float lastOffsetBefore = 0.0f;
|
||||
float lastOffsetAfter = 0.0f;
|
||||
float primaryOverflow = 0.0f;
|
||||
std::string lastTargetStateKey = {};
|
||||
std::string primaryTargetStateKey = {};
|
||||
std::string lastResult = {};
|
||||
};
|
||||
|
||||
UIScreenLoadResult LoadScreen(const UIScreenAsset& asset) override;
|
||||
UIScreenFrameResult BuildFrame(
|
||||
const UIScreenDocument& document,
|
||||
const UIScreenFrameInput& input) override;
|
||||
const ScrollDebugSnapshot& GetScrollDebugSnapshot() const;
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, float> m_verticalScrollOffsets = {};
|
||||
ScrollDebugSnapshot m_scrollDebugSnapshot = {};
|
||||
};
|
||||
|
||||
} // namespace Runtime
|
||||
|
||||
Reference in New Issue
Block a user