mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
feat: autoresize (extend/shrink) canvas element
This commit is contained in:
parent
b644a76904
commit
0d4838facf
7 changed files with 52 additions and 17 deletions
|
|
@ -9,21 +9,23 @@ class Texture;
|
|||
namespace gui {
|
||||
class Canvas final : public UINode {
|
||||
public:
|
||||
explicit Canvas(GUI& gui, ImageFormat inFormat, glm::uvec2 inSize);
|
||||
explicit Canvas(GUI& gui, ImageFormat format, glm::uvec2 size);
|
||||
|
||||
~Canvas() override = default;
|
||||
|
||||
void draw(const DrawContext& pctx, const Assets& assets) override;
|
||||
|
||||
[[nodiscard]] auto texture() const {
|
||||
return mTexture;
|
||||
void setSize(glm::vec2 size) override;
|
||||
|
||||
[[nodiscard]] auto getTexture() const {
|
||||
return texture;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto data() const {
|
||||
return mData;
|
||||
[[nodiscard]] auto getData() const {
|
||||
return data;
|
||||
}
|
||||
private:
|
||||
std::shared_ptr<::Texture> mTexture;
|
||||
std::shared_ptr<ImageData> mData;
|
||||
std::shared_ptr<::Texture> texture;
|
||||
std::shared_ptr<ImageData> data;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue