Fixed two bugs in Effect. 1. The shaders weren't being applied to everything, only shapes. 2. The Textual components were getting a not-shape shader but should be shapes.

This commit is contained in:
Zed A. Shaw 2025-05-10 12:54:11 -04:00
parent adc192c6dc
commit cf3da32681
3 changed files with 3 additions and 3 deletions

View file

@ -157,13 +157,13 @@ struct CalculatorUI {
auto& label = LABELS.at(name);
$gui.set<guecs::Rectangle>(id, {});
$gui.set<guecs::Effect>(id, {});
if(name == "readout") {
$gui.set<guecs::Textual>(id, {L"", 40});
} else if(name == "stack") {
$gui.set<guecs::Textual>(id, {L"", 20});
} else {
$gui.set<guecs::Effect>(id, {});
$gui.set<guecs::Label>(id, { label });
wchar_t op = label[0];
$gui.set<guecs::Clickable>(id, {

View file

@ -213,7 +213,7 @@ namespace guecs {
sf::Shader *shader_ptr = nullptr;
if(auto shader = get_if<Effect>(ent)) {
if(shader->$active && !is_shape) {
if(shader->$active) {
auto ptr = shader->checkout_ptr();
ptr->setUniform("is_shape", is_shape);
// NOTE: this is needed because SFML doesn't handle shared_ptr

View file

@ -124,7 +124,7 @@ namespace guecs {
});
query<Textual>([&](auto ent, auto& text) {
render_helper(window, ent, true, text.text);
render_helper(window, ent, false, text.text);
});
}