Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradient tags in combination with length modifying tags #1045

Open
CubBossa opened this issue Feb 27, 2024 · 0 comments
Open

Gradient tags in combination with length modifying tags #1045

CubBossa opened this issue Feb 27, 2024 · 0 comments

Comments

@CubBossa
Copy link

CubBossa commented Feb 27, 2024

Assuming there were a <repeat:_amount_> tag, a wrapping gradient tag would not be able to apply its gradient correctly scaled on the repeated content.

The code that I used for the repeat tag to reproduce this was

return (Modifying) (current, depth) -> {
    if (depth > 0) return Component.empty();
    Component c = Component.empty();
    for (int i = 0; i < count; i++) {
        c = c.append(current);
    }
    return c;
}

Against what I expected, <gradient:black:dark_gray:black><repeat:12>-</repeat><slot/> produced gradients scaled on <slot/>#length + 1 only
grafik

From what code I found online, it looks like gradient tags only take child Inserting tags into account and not child Modifying tags.

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

No branches or pull requests

1 participant