Skip to content

Adds missing filter flags for the outline filter.#206

Merged
SpaceManiac merged 1 commit intoSpaceManiac:masterfrom
Neerti:filter_flags_fix
Aug 15, 2020
Merged

Adds missing filter flags for the outline filter.#206
SpaceManiac merged 1 commit intoSpaceManiac:masterfrom
Neerti:filter_flags_fix

Conversation

@Neerti
Copy link
Copy Markdown
Contributor

@Neerti Neerti commented Aug 14, 2020

Fixes #205
Tried to fix the issue I found last night in the same way that #165 added other filter flags, but that PR seemed to have forgotten to add the two outline flags.

I tested this locally and the error doesn't come up now so it does work.

Hopefully I did everything right, let me know if there's any issues.

@ZeWaka
Copy link
Copy Markdown
Contributor

ZeWaka commented Aug 14, 2020

You'll need to add stuff here I think:

pub static VALID_FILTER_TYPES: phf::Map<&'static str, &[&str]> = phf_map! {
"alpha" => &[ "x", "y", "icon", "render_source", "flags" ],
"angular_blur" => &[ "x", "y", "size" ],
"color" => &[ "color", "space" ],
"displace" => &[ "x", "y", "size", "icon", "render_source" ],
"drop_shadow" => &[ "x", "y", "size", "offset", "color"],
"blur" => &[ "size" ],
"layer" => &[ "x", "y", "icon", "render_source", "flags", "color", "transform", "blend_mode" ],
"motion_blur" => &[ "x", "y" ],
"outline" => &[ "size", "color" ],
"radial_blur" => &[ "x", "y", "size" ],
"rays" => &[ "x", "y", "size", "color", "offset", "density", "threshold", "factor", "flags" ],
"ripple" => &[ "x", "y", "size", "repeat", "radius", "falloff", "flags" ],
"wave" => &[ "x", "y", "size", "offset", "flags" ],
};
// filter type => (flag field name, exclusive, can_be_0, valid flag values)
pub static VALID_FILTER_FLAGS: phf::Map<&'static str, (&str, bool, bool, &[&str])> = phf_map! {
"alpha" => ("flags", false, true, &[ "MASK_INVERSE", "MASK_SWAP" ]),
"color" => ("space", true, false, &[ "FILTER_COLOR_RGB", "FILTER_COLOR_HSV", "FILTER_COLOR_HSL", "FILTER_COLOR_HCY" ]),
"layer" => ("flags", true, true, &[ "FLAG_OVERLAY", "FLAG_UNDERLAY" ]),
"rays" => ("flags", false, true, &[ "FLAG_OVERLAY", "FLAG_UNDERLAY" ]),
"ripple" => ("flags", false, true, &[ "WAVE_BOUND" ]),
"wave" => ("flags", false, true, &[ "WAVE_SIDEWAYS", "WAVE_BOUND" ]),
};

@Neerti
Copy link
Copy Markdown
Contributor Author

Neerti commented Aug 15, 2020

When I look on the latest version on the master branch, that block of code appears to already have the outline stuff there.

"outline" => &[ "size", "color", "flags" ],

"outline" => ("flags", false, true, &[ "OUTLINE_SHARP", "OUTLINE_SQUARE" ]),

@SpaceManiac SpaceManiac merged commit 235ae71 into SpaceManiac:master Aug 15, 2020
@SpaceManiac SpaceManiac added this to the suite v1.6 milestone Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DM-Langserver does not know about builtin Filter flags

3 participants