Skip to content

Commit 8e9afb8

Browse files
committed
make GetSize const
1 parent 2cf2877 commit 8e9afb8

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

include/Core/Drawable.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Drawable {
2222
public:
2323
virtual ~Drawable() = default;
2424
virtual void Draw(const Util::Transform &transform, const float zIndex) = 0;
25-
virtual glm::vec2 GetSize() = 0;
25+
virtual glm::vec2 GetSize() const = 0;
2626
};
2727
} // namespace Core
2828

include/Util/Image.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Image : public Core::Drawable {
1717
public:
1818
Image(const std::string &filepath);
1919

20-
glm::vec2 GetSize() override;
20+
glm::vec2 GetSize() const override { return m_Size; };
2121

2222
void Draw(const Util::Transform &transform, const float zIndex) override;
2323

include/Util/Text.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Text : public Core::Drawable {
1616
public:
1717
Text(const std::string &font, int size, const std::string &text);
1818

19-
glm::vec2 GetSize() override { return m_Size; };
19+
glm::vec2 GetSize() const override { return m_Size; };
2020

2121
void Draw(const Transform &transform, const float zIndex) override;
2222

src/Util/Image.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ void Image::InitUniformBuffer() {
9595
*s_Program, "Matrices", 0);
9696
}
9797

98-
glm::vec2 Image::GetSize() {
99-
return m_Size;
100-
}
101-
10298
std::unique_ptr<Core::Program> Image::s_Program = nullptr;
10399
std::unique_ptr<Core::VertexArray> Image::s_VertexArray = nullptr;
104100
std::unique_ptr<Core::UniformBuffer<Core::Matrices>> Image::s_UniformBuffer =

0 commit comments

Comments
 (0)