prevent dropdown from closing when moving to parent or child

This commit is contained in:
GenevensiS
2026-04-09 19:30:17 +02:00
parent a99c603ffb
commit 4d1c7aae96
20 changed files with 65 additions and 38 deletions
+12 -6
View File
@@ -81,22 +81,28 @@ SCRIPT_FUNCTION(set_metadata) {
SCRIPT_FUNCTION(width_of) {
SCRIPT_PARAM(Set*, set);
SCRIPT_PARAM(GeneratedImageP, input);
Image image = input->generate(GeneratedImage::Options(0, 0, set->stylesheet.get()));
SCRIPT_PARAM(CardP, card);
SCRIPT_PARAM(GeneratedImageP, input);
StyleSheet* stylesheet = card && card->stylesheet ? card->stylesheet.get() : set->stylesheet.get();
Image image = input->generate(GeneratedImage::Options(0, 0, stylesheet));
SCRIPT_RETURN(image.GetWidth());
}
SCRIPT_FUNCTION(height_of) {
SCRIPT_PARAM(Set*, set);
SCRIPT_PARAM(GeneratedImageP, input);
Image image = input->generate(GeneratedImage::Options(0, 0, set->stylesheet.get()));
SCRIPT_PARAM(CardP, card);
SCRIPT_PARAM(GeneratedImageP, input);
StyleSheet* stylesheet = card && card->stylesheet ? card->stylesheet.get() : set->stylesheet.get();
Image image = input->generate(GeneratedImage::Options(0, 0, stylesheet));
SCRIPT_RETURN(image.GetHeight());
}
SCRIPT_FUNCTION(dimensions_of) {
SCRIPT_PARAM(Set*, set);
SCRIPT_PARAM(GeneratedImageP, input);
Image image = input->generate(GeneratedImage::Options(0, 0, set->stylesheet.get()));
SCRIPT_PARAM(CardP, card);
SCRIPT_PARAM(GeneratedImageP, input);
StyleSheet* stylesheet = card && card->stylesheet ? card->stylesheet.get() : set->stylesheet.get();
Image image = input->generate(GeneratedImage::Options(0, 0, stylesheet));
ScriptCustomCollectionP ret(new ScriptCustomCollection());
ret->value.push_back(to_script(image.GetWidth()));
ret->value.push_back(to_script(image.GetHeight()));