Skip to content

Commit

Permalink
minor fix in drawutils
Browse files Browse the repository at this point in the history
  • Loading branch information
Maschell committed Apr 28, 2024
1 parent 958ba50 commit 8071cea
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/utils/DrawUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,19 @@ void DrawUtils::print(uint32_t x, uint32_t y, const wchar_t *string, bool alignR
textureWidth = (mtx.minWidth + 3) & ~3;
textureHeight = mtx.minHeight;

SFT_Image img = {
.pixels = nullptr,
.width = textureWidth,
.height = textureHeight,
};

if (textureWidth == 0) {
textureWidth = 4;
}
if (textureHeight == 0) {
textureHeight = 4;
}

SFT_Image img = {
.pixels = nullptr,
.width = textureWidth,
.height = textureHeight,
};

auto buffer = make_unique_nothrow<uint8_t[]>((uint32_t) (img.width * img.height));
if (!buffer) {
DEBUG_FUNCTION_LINE_ERR("Failed to allocate memory for glyph");
Expand Down

0 comments on commit 8071cea

Please sign in to comment.