aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/render')
-rw-r--r--include/cru/ui/render/layout_render_object.hpp12
-rw-r--r--include/cru/ui/render/render_object.hpp10
2 files changed, 11 insertions, 11 deletions
diff --git a/include/cru/ui/render/layout_render_object.hpp b/include/cru/ui/render/layout_render_object.hpp
index 8700b8ba..5c4c9c5c 100644
--- a/include/cru/ui/render/layout_render_object.hpp
+++ b/include/cru/ui/render/layout_render_object.hpp
@@ -18,9 +18,9 @@ class LayoutRenderObject : public RenderObject {
~LayoutRenderObject() override = default;
- ChildLayoutData* GetChildLayoutData(int position) {
+ ChildLayoutData* GetChildLayoutData(Index position) {
Expects(position >= 0 &&
- position < static_cast<int>(child_layout_data_.size()));
+ position < static_cast<Index>(child_layout_data_.size()));
return &child_layout_data_[position];
}
@@ -29,8 +29,8 @@ class LayoutRenderObject : public RenderObject {
RenderObject* HitTest(const Point& point) override;
protected:
- void OnAddChild(RenderObject* new_child, int position) override;
- void OnRemoveChild(RenderObject* removed_child, int position) override;
+ void OnAddChild(RenderObject* new_child, Index position) override;
+ void OnRemoveChild(RenderObject* removed_child, Index position) override;
private:
std::vector<ChildLayoutData> child_layout_data_{};
@@ -72,7 +72,7 @@ RenderObject* LayoutRenderObject<TChildLayoutData>::HitTest(
template <typename TChildLayoutData>
void LayoutRenderObject<TChildLayoutData>::OnAddChild(RenderObject* new_child,
- int position) {
+ const Index position) {
CRU_UNUSED(new_child)
child_layout_data_.emplace(child_layout_data_.cbegin() + position);
@@ -80,7 +80,7 @@ void LayoutRenderObject<TChildLayoutData>::OnAddChild(RenderObject* new_child,
template <typename TChildLayoutData>
void LayoutRenderObject<TChildLayoutData>::OnRemoveChild(
- RenderObject* removed_child, int position) {
+ RenderObject* removed_child, const Index position) {
CRU_UNUSED(removed_child)
child_layout_data_.erase(child_layout_data_.cbegin() + position);
diff --git a/include/cru/ui/render/render_object.hpp b/include/cru/ui/render/render_object.hpp
index ca31386a..33ef3d1a 100644
--- a/include/cru/ui/render/render_object.hpp
+++ b/include/cru/ui/render/render_object.hpp
@@ -53,9 +53,9 @@ class RenderObject : public Object {
RenderObject* GetParent() const { return parent_; }
const std::vector<RenderObject*>& GetChildren() const { return children_; }
- int GetChildCount() const { return static_cast<int>(children_.size()); }
- void AddChild(RenderObject* render_object, int position);
- void RemoveChild(int position);
+ Index GetChildCount() const { return static_cast<Index>(children_.size()); }
+ void AddChild(RenderObject* render_object, Index position);
+ void RemoveChild(Index position);
Point GetOffset() const { return offset_; }
void SetOffset(const Point& offset) { offset_ = offset; }
@@ -99,9 +99,9 @@ class RenderObject : public Object {
RenderObject* new_parent);
// default is to invalidate both layout and paint
- virtual void OnAddChild(RenderObject* new_child, int position);
+ virtual void OnAddChild(RenderObject* new_child, Index position);
// default is to invalidate both layout and paint
- virtual void OnRemoveChild(RenderObject* removed_child, int position);
+ virtual void OnRemoveChild(RenderObject* removed_child, Index position);
virtual void OnMeasureCore(const Size& available_size);
virtual void OnLayoutCore(const Rect& rect);