Files
XCEngine/new_editor/include/XCEditor/Collections/UIEditorScrollViewInteraction.h

43 lines
1.2 KiB
C++

#pragma once
#include <XCEditor/Collections/UIEditorScrollView.h>
#include <XCEngine/UI/Types.h>
#include <vector>
namespace XCEngine::UI::Editor {
struct UIEditorScrollViewInteractionState {
Widgets::UIEditorScrollViewState scrollViewState = {};
::XCEngine::UI::UIPoint pointerPosition = {};
float thumbDragStartPointerY = 0.0f;
float thumbDragStartOffset = 0.0f;
bool hasPointerPosition = false;
};
struct UIEditorScrollViewInteractionResult {
bool consumed = false;
bool offsetChanged = false;
bool focusChanged = false;
bool startedThumbDrag = false;
bool endedThumbDrag = false;
Widgets::UIEditorScrollViewHitTarget hitTarget = {};
float verticalOffset = 0.0f;
};
struct UIEditorScrollViewInteractionFrame {
Widgets::UIEditorScrollViewLayout layout = {};
UIEditorScrollViewInteractionResult result = {};
};
UIEditorScrollViewInteractionFrame UpdateUIEditorScrollViewInteraction(
UIEditorScrollViewInteractionState& state,
float& verticalOffset,
const ::XCEngine::UI::UIRect& bounds,
float contentHeight,
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
const Widgets::UIEditorScrollViewMetrics& metrics = {});
} // namespace XCEngine::UI::Editor