aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/GeometryRenderObject.h
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-11-21 21:43:42 +0800
committerYuqian Yang <crupest@crupest.life>2025-11-21 22:13:54 +0800
commitfd61739197ec009d47da87a7cc66970a55f12db4 (patch)
treebb2bc007aaf9b47fecb090df96c23b5ee6a898e3 /include/cru/ui/render/GeometryRenderObject.h
parent3b875091c445b7465b9bd044914318989a94d2ad (diff)
downloadcru-fd61739197ec009d47da87a7cc66970a55f12db4.tar.gz
cru-fd61739197ec009d47da87a7cc66970a55f12db4.tar.bz2
cru-fd61739197ec009d47da87a7cc66970a55f12db4.zip
Clean codes. Remove member function const in RenderObject.
Diffstat (limited to 'include/cru/ui/render/GeometryRenderObject.h')
-rw-r--r--include/cru/ui/render/GeometryRenderObject.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/include/cru/ui/render/GeometryRenderObject.h b/include/cru/ui/render/GeometryRenderObject.h
index 5d2ba1e0..1c998ef0 100644
--- a/include/cru/ui/render/GeometryRenderObject.h
+++ b/include/cru/ui/render/GeometryRenderObject.h
@@ -1,39 +1,37 @@
#pragma once
+#include "MeasureRequirement.h"
#include "RenderObject.h"
-#include "cru/platform/graphics/Brush.h"
-#include "cru/platform/graphics/Geometry.h"
-#include "cru/ui/render/MeasureRequirement.h"
+
+#include <cru/platform/graphics/Brush.h>
+#include <cru/platform/graphics/Geometry.h>
#include <optional>
namespace cru::ui::render {
class GeometryRenderObject : public RenderObject {
public:
- GeometryRenderObject();
+ static constexpr auto kRenderObjectName = "GeometryRenderObject";
- CRU_DELETE_COPY(GeometryRenderObject)
- CRU_DELETE_MOVE(GeometryRenderObject)
-
- ~GeometryRenderObject() override;
+ GeometryRenderObject();
public:
void Draw(platform::graphics::IPainter* painter) override;
RenderObject* HitTest(const Point& point) override;
- std::shared_ptr<platform::graphics::IGeometry> GetGeometry() const;
+ std::shared_ptr<platform::graphics::IGeometry> GetGeometry();
void SetGeometry(std::shared_ptr<platform::graphics::IGeometry> geometry,
std::optional<Rect> view_port = std::nullopt);
- Rect GetViewPort() const;
+ Rect GetViewPort();
void SetViewPort(const Rect& view_port);
- std::shared_ptr<platform::graphics::IBrush> GetFillBrush() const;
+ std::shared_ptr<platform::graphics::IBrush> GetFillBrush();
void SetFillBrush(std::shared_ptr<platform::graphics::IBrush> brush);
- std::shared_ptr<platform::graphics::IBrush> GetStrokeBrush() const;
+ std::shared_ptr<platform::graphics::IBrush> GetStrokeBrush();
void SetStrokeBrush(std::shared_ptr<platform::graphics::IBrush> brush);
- float GetStrokeWidth() const;
+ float GetStrokeWidth();
void SetStrokeWidth(float width);
protected: