Added ImageRect::FitImageToBounds

This commit is contained in:
2025-02-11 18:35:10 -05:00
parent 24d5065f01
commit ad2e3e9a45
2 changed files with 8 additions and 4 deletions

View File

@@ -9,15 +9,12 @@
/// @desc A widget that contains and renders an image provided by JGL, within a rectangular frame.
/// @edit 2024-08-05
#pragma once
#include <JUI/Widgets/Rect.hpp>
#include <JUI/Base/ImageBase.hpp>
namespace JUI
{
namespace JUI {
class ImageRect: public Rect, public ImageBase {
public:
ImageRect();
@@ -25,5 +22,10 @@ namespace JUI
void Update(float delta) override;
void Draw() override;
bool FitImageToBounds() const { return fit_image_to_bounds;}
void FitImageToBounds(bool value) { fit_image_to_bounds = value;}
protected:
bool fit_image_to_bounds;
};
}

View File

@@ -8,6 +8,8 @@ JUI::ImageRect::ImageRect(JUI::Widget *parent) : ImageRect() {
void JUI::ImageRect::Update(float delta) {
Rect::Update(delta);
}
void JUI::ImageRect::Draw() {