关键节点
This commit is contained in:
23
editor/include/XCEditor/Foundation/UIEditorTextMeasurement.h
Normal file
23
editor/include/XCEditor/Foundation/UIEditorTextMeasurement.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <string_view>
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
struct UIEditorTextMeasureRequest {
|
||||
std::string_view text = {};
|
||||
float fontSize = 0.0f;
|
||||
};
|
||||
|
||||
class UIEditorTextMeasurer {
|
||||
public:
|
||||
virtual ~UIEditorTextMeasurer() = default;
|
||||
|
||||
virtual float MeasureTextWidth(const UIEditorTextMeasureRequest& request) const = 0;
|
||||
|
||||
virtual float MeasureTextAdvance(const UIEditorTextMeasureRequest& request) const {
|
||||
return MeasureTextWidth(request);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
Reference in New Issue
Block a user