Skip to content

RGBW buffer logic likely wrong #16

Description

@cbiffle

I haven't run the code, but I was driving by and I noticed this line. Which reads:

this.pixels = new Pixel[length * (3/4)]; // changing this to 3/4

3/4 in Java is an integer division expression that evaluates to zero. If you're trying to scale an integer by 3/4, removing the parentheses will get the right answer, assuming it doesn't overflow.

The corresponding logic to switch back out of RGBW seems to have the wrong multiplier, in addition to the zero bug.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions