From 5d4ac180f85b39e72624f4b8d17925d91ebe4278 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Thu, 30 Nov 2023 19:01:45 +0100 Subject: [PATCH] handle VNone for filters --- haxe/ui/styles/Style.hx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/haxe/ui/styles/Style.hx b/haxe/ui/styles/Style.hx index b82897c2c..1fae2e6e3 100644 --- a/haxe/ui/styles/Style.hx +++ b/haxe/ui/styles/Style.hx @@ -411,16 +411,13 @@ class Style { native = ValueTools.bool(v.value); case "filter": - #if !haxeui_nofilters - filter = []; - parseFilter(v.value, filter); + #if (!haxeui_nofilters && !haxeui_no_filters) + filter = parseFilter(v.value); #end case "backdrop-filter": - #if !haxeui_nofilters - backdropFilter = []; - parseFilter(v.value, backdropFilter); - + #if (!haxeui_nofilters && !haxeui_no_filters) + backdropFilter = parseFilter(v.value); #end case "resource": @@ -784,7 +781,10 @@ class Style { if (animationOptions == null) animationOptions = {}; } - private function parseFilter(value:Value, filters:Array) { + private function parseFilter(value:Value, filters:Array = null) { + if (filters == null) { + filters = []; + } switch (value) { case Value.VCall(f, vl): var arr = ValueTools.array(vl); @@ -801,7 +801,9 @@ class Style { case Value.VComposite(vl): for (v in vl) { parseFilter(v, filters); - } + } + case Value.VNone: + filters = null; case _: } return filters;