Skip to content

Commit

Permalink
handle VNone for filters
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Nov 30, 2023
1 parent 6a3500a commit 5d4ac18
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions haxe/ui/styles/Style.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -784,7 +781,10 @@ class Style {
if (animationOptions == null) animationOptions = {};
}

private function parseFilter(value:Value, filters:Array<Filter>) {
private function parseFilter(value:Value, filters:Array<Filter> = null) {
if (filters == null) {
filters = [];
}
switch (value) {
case Value.VCall(f, vl):
var arr = ValueTools.array(vl);
Expand All @@ -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;
Expand Down

0 comments on commit 5d4ac18

Please sign in to comment.