Uhhhhhhhhh

This commit is contained in:
2025-06-07 11:45:46 -05:00
parent 134fa46f5a
commit 37d14cc0e0
3 changed files with 7 additions and 3 deletions

View File

@@ -64,7 +64,7 @@ CPMAddPackage(
CPMAddPackage(
NAME JGL
URL https://git.redacted.cc/josh/JGL/archive/Prerelease-57.zip
URL https://git.redacted.cc/josh/JGL/archive/Prerelease-56.zip
)
target_include_directories(JUI PUBLIC ${Event_SOURCE_DIR}/include)

View File

@@ -86,7 +86,7 @@ void TextBase::Draw(const Vector2& abs_pos, const Vector2& abs_size, const std::
if (content == this->content) {
// if Render Target needs updating.
if (state_redraw) {
text_canvas->Resize({(int) bounds.x, (int) bounds.y});
text_canvas->Resize({(int) bounds.x+20, (int) bounds.y});
J2D::Begin(text_canvas, nullptr, true);
//J2D::FillRect(Colors::Red, {0,0}, bounds);
J2D::DrawString(color, content, 0, 0, size, scale, this->font);
@@ -102,10 +102,14 @@ void TextBase::Draw(const Vector2& abs_pos, const Vector2& abs_size, const std::
use_render_target ? J2D::DrawRenderTarget(text_canvas, {align_x, align_y})
: J2D::DrawString(color, content, align_x, align_y, size, scale, this->font);
//J2D::End();
Vector2 bounds2 = this->font.MeasureString(content, this->text_size);
JGL::J2D::OutlineRect(Colors::Red, text_pos, bounds2);
}
void TextBase::Draw(const Vector2& abs_pos, const Vector2& abs_size) {
Draw(abs_pos, abs_size, this->content, this->text_size, this->text_color);
}
std::string TextBase::Content() const { return content; }

View File

@@ -50,7 +50,7 @@ namespace JUI {
btn->Font(Fonts::Jupiteroid);
btn->TextSize(14);
btn->TextColor(Colors::Black);
btn->Size({static_cast<int>(str_width.x)+16, 0, 0, 1});
btn->Size({static_cast<int>(str_width.x)+16, 0, 0, 1});
btn->BorderWidth(0.f);
btn->Content(name);