aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/RenderObject.h
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-11-22 16:55:53 +0800
committerYuqian Yang <crupest@crupest.life>2025-11-22 16:55:53 +0800
commit7ce185d5a3fcfad8c8f746f95f3d50a8829faac4 (patch)
treec1f00529a1286748836332b62ae79404b3a83f36 /include/cru/ui/render/RenderObject.h
parentd97c14a922b60e89a9892e519b95b7e793aff543 (diff)
downloadcru-7ce185d5a3fcfad8c8f746f95f3d50a8829faac4.tar.gz
cru-7ce185d5a3fcfad8c8f746f95f3d50a8829faac4.tar.bz2
cru-7ce185d5a3fcfad8c8f746f95f3d50a8829faac4.zip
Clean codes. Remove Measure1.
Diffstat (limited to 'include/cru/ui/render/RenderObject.h')
-rw-r--r--include/cru/ui/render/RenderObject.h34
1 files changed, 9 insertions, 25 deletions
diff --git a/include/cru/ui/render/RenderObject.h b/include/cru/ui/render/RenderObject.h
index 5569c788..ce788ca6 100644
--- a/include/cru/ui/render/RenderObject.h
+++ b/include/cru/ui/render/RenderObject.h
@@ -103,12 +103,6 @@ class CRU_UI_API RenderObject : public Object {
return custom_measure_requirement_;
}
- Size GetMinSize1() { return min_size_; }
- void SetMinSize1(const Size& min_size);
- Size GetMaxSize1() { return max_size_; }
- void SetMaxSize1(const Size& max_size);
- BoxConstraint CalculateMergedConstraint(const BoxConstraint& constraint);
-
// This method will merge requirement passed by argument and requirement of
// the render object using MeasureRequirement::Merge and then call
// MeasureRequirement::Normalize on it. And it will use preferred size of the
@@ -121,8 +115,6 @@ class CRU_UI_API RenderObject : public Object {
// This will set offset of this render object and call OnLayoutCore.
void Layout(const Point& offset);
- Size Measure1(const BoxConstraint& constraint);
-
virtual Thickness GetTotalSpaceThickness();
virtual Thickness GetInnerSpaceThickness();
@@ -156,8 +148,6 @@ class CRU_UI_API RenderObject : public Object {
virtual Size OnMeasureCore(const MeasureRequirement& requirement,
const MeasureSize& preferred_size);
- virtual Size OnMeasureCore1(const BoxConstraint& constraint);
-
// Please reduce margin and padding or other custom things and pass the result
// content rect to OnLayoutContent.
virtual void OnLayoutCore();
@@ -169,8 +159,6 @@ class CRU_UI_API RenderObject : public Object {
virtual Size OnMeasureContent(const MeasureRequirement& requirement,
const MeasureSize& preferred_size) = 0;
- virtual Size OnMeasureContent1(const BoxConstraint& constraint);
-
// Layout all content and children(Call Layout on them).
// Lefttop of content_rect should be added when calculated children's offset.
virtual void OnLayoutContent(const Rect& content_rect) = 0;
@@ -182,22 +170,18 @@ class CRU_UI_API RenderObject : public Object {
private:
std::string name_;
- controls::Control* control_ = nullptr;
-
- RenderObject* parent_ = nullptr;
-
- Point offset_{};
- Size size_{};
+ controls::Control* control_;
+ RenderObject* parent_;
- Size desired_size_{};
+ Point offset_;
+ Size size_;
- Thickness margin_{};
- Thickness padding_{};
+ Size desired_size_;
- MeasureSize preferred_size_{};
- MeasureRequirement custom_measure_requirement_{};
+ Thickness margin_;
+ Thickness padding_;
- Size min_size_ = Size::kZero;
- Size max_size_ = Size::kMax;
+ MeasureSize preferred_size_;
+ MeasureRequirement custom_measure_requirement_;
};
} // namespace cru::ui::render