Skip to content

Commit

Permalink
Dev (#13)
Browse files Browse the repository at this point in the history
* cleanup: added check if string is not null or empty before  doing calculations with it
  • Loading branch information
mlthelama authored Feb 18, 2023
1 parent 021e65f commit 4c49336
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.20)

set(NAME "LamasTinyHUD")
set(VERSION 1.2.1.0)
set(VERSION 1.2.2.0)

# ---- Options ----

Expand Down
7 changes: 6 additions & 1 deletion src/ui/ui_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ namespace ui {
//it should center the text, it kind of does
auto text_x = 0.f;
auto text_y = 0.f;
const ImVec2 text_size = ImGui::CalcTextSize(a_text, nullptr, true);

if (!a_text || !*a_text) {
return;
}

const ImVec2 text_size = ImGui::CalcTextSize(a_text);
if (a_center_text) {
text_x = -text_size.x * 0.5f;
text_y = -text_size.y * 0.5f;
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lamastinyhud",
"version-string": "1.2.1",
"version-string": "1.2.2",
"description": "hud element for skyrim",
"homepage": "https://github.com/mlthelama/LamasTinyHUD",
"license": "GPL-2.0-or-later",
Expand Down

0 comments on commit 4c49336

Please sign in to comment.