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

Some patterns don't replace #116

Open
bbulkow opened this issue Nov 13, 2022 · 4 comments
Open

Some patterns don't replace #116

bbulkow opened this issue Nov 13, 2022 · 4 comments
Assignees
Labels
1 HighPriority - chromatik really should get fixed

Comments

@bbulkow
Copy link
Collaborator

bbulkow commented Nov 13, 2022

There are a set of patterns which don't touch large parts of the sculpture - like shrubs - but if you use it, you expect those elements to go to 0 (opaque).

Is this correct? It's certainly unexpected.

Change this description to the patterns in question - see how bad it is

@bbulkow bbulkow added the 2 MediumPriority - chromatik nice to fix but can go live without it label Nov 13, 2022
@bbulkow bbulkow self-assigned this Nov 13, 2022
@cswales
Copy link
Collaborator

cswales commented Nov 14, 2022

@bbulkow - which patterns are you referring to? It's not how the patterns are currently coded, but it should be easy enough to change if that's the behavior you're looking for.
In the run loop, instead of filtering children by model.sub(), you want to loop through all the children, applying the pattern on ones where the tag matches, and blacking out pixels on the other ones.

@cswales cswales added 1 HighPriority - chromatik really should get fixed and removed 2 MediumPriority - chromatik nice to fix but can go live without it labels Nov 15, 2022
@cswales cswales added this to the On Site Testing milestone Nov 15, 2022
@mcslee
Copy link
Collaborator

mcslee commented Nov 15, 2022

Documenting example fix here:
1da45e0

FYI just to avoid confusion, opaque is 0xff000000 which is also available as LXColor.BLACK - going to 0 will technically be full alpha transparency aka LXColor.CLEAR

Almost always best/safest to use LXColor.BLACK unless you're really sure you want alpha-transparency.

@cswales
Copy link
Collaborator

cswales commented Nov 15, 2022

There is now a TSBufferedPattern class that does the frame buffering magic that Mark has in his example fix. The quickest way to fix a pattern is to have it derive from TSBufferedPattern, and change run() to bufferedRun().

I've done this with a couple of the patterns.

@cswales
Copy link
Collaborator

cswales commented Nov 17, 2022

I've gone through and modified patterns that were only touching things like trees or shrubs. There may be one or two left, but things should be shippable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 HighPriority - chromatik really should get fixed
Projects
None yet
Development

No branches or pull requests

3 participants