mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-15 13:42:39 +03:00
Rename Drawable::createInstance() to clone() and update drawable implementations, typed helpers, consumers, tests, tools, and external modules. Avoid retaining private icon clones for immediate single-threaded rendering in the code editor and ecode plugins. Borrow cached per-size icon sources instead, restoring temporary color changes after drawing, while preserving owned clones for widgets, menus, models, and other stateful consumers. Reduce common drawable allocation overhead by lazily creating DrawableResource callback state, using inline callback storage and notification snapshots, and safely supporting callback disconnection during notification. Lazily allocate UIImage and UINodeDrawable asynchronous lifetime tokens only when an uncached asynchronous load is actually scheduled. Document the distinction between borrowed immediate rendering and independently owned drawable state.
68 lines
1.4 KiB
C++
68 lines
1.4 KiB
C++
#ifndef EE_GRAPHICS_ARCDRAWABLE
|
|
#define EE_GRAPHICS_ARCDRAWABLE
|
|
|
|
#include <eepp/core.hpp>
|
|
#include <eepp/graphics/primitivedrawable.hpp>
|
|
|
|
namespace EE { namespace Graphics {
|
|
|
|
class EE_API ArcDrawable : public PrimitiveDrawable {
|
|
public:
|
|
static ArcDrawable* New();
|
|
|
|
static ArcDrawable* New( const Float& radius, Uint32 segmentsCount = 64,
|
|
const Float& arcAngle = 360.f, const Float& arcStartAngle = 0.f );
|
|
|
|
ArcDrawable();
|
|
|
|
ArcDrawable( const Float& radius, Uint32 segmentsCount = 64, const Float& arcAngle = 360.f,
|
|
const Float& arcStartAngle = 0.f );
|
|
|
|
virtual Sizef getSize();
|
|
|
|
virtual Sizef getPixelsSize();
|
|
|
|
virtual void draw();
|
|
|
|
virtual void draw( const Vector2f& position );
|
|
|
|
virtual void draw( const Vector2f& position, const Sizef& size );
|
|
|
|
virtual bool isStateful() { return false; }
|
|
|
|
DrawablePtr clone() const;
|
|
|
|
Float getRadius() const;
|
|
|
|
void setRadius( const Float& radius );
|
|
|
|
Float getArcAngle() const;
|
|
|
|
void setArcAngle( const Float& arcAngle );
|
|
|
|
Float getArcStartAngle() const;
|
|
|
|
void setArcStartAngle( const Float& arcStartAngle );
|
|
|
|
Uint32 getSegmentsCount() const;
|
|
|
|
void setSegmentsCount( const Uint32& segmentsCount );
|
|
|
|
const Vector2f& getOffset() const;
|
|
|
|
void setOffset( const Vector2f& offset );
|
|
|
|
protected:
|
|
Float mRadius;
|
|
Uint32 mSegmentsCount;
|
|
Float mArcAngle;
|
|
Float mArcStartAngle;
|
|
Vector2f mOffset;
|
|
|
|
void updateVertex();
|
|
};
|
|
|
|
}} // namespace EE::Graphics
|
|
|
|
#endif
|