Skip to content

Commit

Permalink
allow for null<> versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Dec 30, 2024
1 parent a2c6b6f commit 146e9d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions haxe/ui/util/TypeConverter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class TypeConverter {
return input;
}
switch (type.toLowerCase()) {
case "string":
case "string" | "null<string>":
return Std.string(input);
case "bool":
case "bool" | "null<bool>":
return Std.string(input) == "true";
case "int":
case "int" | "null<int>":
if (input == null) {
return 0;
}
Expand All @@ -40,7 +40,7 @@ class TypeConverter {
return 0;
}
return r;
case "float":
case "float" | "null<float>":
if (input == null) {
return 0;
}
Expand All @@ -49,7 +49,7 @@ class TypeConverter {
return 0;
}
return r;
case "color":
case "color" | "null<color>":
return Color.fromString(Std.string(input));
case "variant" | "dynamic" | "scalemode" | "selectionmode" | "scrollpolicy" | "scrollmode":
return input;
Expand Down

0 comments on commit 146e9d6

Please sign in to comment.