diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-21 21:43:42 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-21 22:13:54 +0800 |
| commit | fd61739197ec009d47da87a7cc66970a55f12db4 (patch) | |
| tree | bb2bc007aaf9b47fecb090df96c23b5ee6a898e3 /include/cru/ui/render/GeometryRenderObject.h | |
| parent | 3b875091c445b7465b9bd044914318989a94d2ad (diff) | |
| download | cru-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.h | 24 |
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: |
