Map QA selector input through public RmlUI projection (by Codex)
This commit is contained in:
1 parent
d8beaecd6f
commit
9061123c7e
6 files changed
+169
-3
No files matched your search
@@ -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>()};
|
||||
|
||||
Reference in new issue
Block a user