Map QA selector input through public RmlUI projection (by Codex)

This commit is contained in:
Codex authored and Codex committed 2026-10-27 07:30:46 +01:00
1 parent d8beaecd6f
commit 9061123c7e
6 files changed
+169 -3

No files matched your search

+4 -3
View File
@@ -881,9 +881,10 @@ void App::script() {
doc_->QuerySelector(command.at("selector").get<std::string>());
if (!node || !node->IsVisible(true))
throw editor::Error("UI-Skript: Element nicht sichtbar.");
const auto at = node->GetAbsoluteOffset(Rml::BoxArea::Border),
size = node->GetBox().GetSize(Rml::BoxArea::Border);
return Rml::Vector2i{int(at.x + size.x * .5f), int(at.y + size.y * .5f)};
const auto point = script_click_point(*context_, *node);
if (!point)
throw editor::Error("UI-Skript: Elementmitte ist nicht sichtbar anklickbar oder die Transformation ist singulär.");
return *point;
}
return Rml::Vector2i{command.at("x").get<int>(),
command.at("y").get<int>()};