aboutsummaryrefslogtreecommitdiff
path: root/src/gui/Label.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-07 00:21:32 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-07 00:21:35 +0200
commita3e479d5b289166ff651fac4ff046656cf78cda0 (patch)
tree2ba345228acfe45acf9863bb122e163ed38db7db /src/gui/Label.cpp
parentb229b060add5f66bd5532698c4a790285095e98a (diff)
Add radio button with simple/advanced view, add widget visibility
Diffstat (limited to 'src/gui/Label.cpp')
-rw-r--r--src/gui/Label.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/Label.cpp b/src/gui/Label.cpp
index 08f720b..09fd1a6 100644
--- a/src/gui/Label.cpp
+++ b/src/gui/Label.cpp
@@ -11,11 +11,17 @@ namespace gsr {
}
void Label::draw(mgl::Window &window, mgl::vec2f offset) {
+ if(!visible)
+ return;
+
text.set_position((position + offset).floor());
window.draw(text);
}
mgl::vec2f Label::get_size() {
+ if(!visible)
+ return {0.0f, 0.0f};
+
return text.get_bounds().size;
}
} \ No newline at end of file