From 146e9d62047984af652ff0e6147b94ff96869190 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Mon, 30 Dec 2024 13:21:41 +0100 Subject: [PATCH] allow for null<> versions --- haxe/ui/util/TypeConverter.hx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/haxe/ui/util/TypeConverter.hx b/haxe/ui/util/TypeConverter.hx index 103f9f763..ae927fafc 100644 --- a/haxe/ui/util/TypeConverter.hx +++ b/haxe/ui/util/TypeConverter.hx @@ -27,11 +27,11 @@ class TypeConverter { return input; } switch (type.toLowerCase()) { - case "string": + case "string" | "null": return Std.string(input); - case "bool": + case "bool" | "null": return Std.string(input) == "true"; - case "int": + case "int" | "null": if (input == null) { return 0; } @@ -40,7 +40,7 @@ class TypeConverter { return 0; } return r; - case "float": + case "float" | "null": if (input == null) { return 0; } @@ -49,7 +49,7 @@ class TypeConverter { return 0; } return r; - case "color": + case "color" | "null": return Color.fromString(Std.string(input)); case "variant" | "dynamic" | "scalemode" | "selectionmode" | "scrollpolicy" | "scrollmode": return input;