Skip to content

Fix calculation of final drawBit in drawVerticalLine #65

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

Merged
merged 1 commit into from
Jul 15, 2016

Conversation

igrr
Copy link
Contributor

@igrr igrr commented Jul 10, 2016

Bitwise "and" has lower precedence than shift, so calculation of drawBit was not working the way it was intended, resulting in the following output (left). Correct output is on the right.
image

Test case:

  display.clear();
  int x = 4;
  const int y0 = 16;
  for (int length = 1; length <= 32; ++length) {
    display.drawVerticalLine(x, y0, length);
    ++x;
  }
  display.display();

@FWeinb FWeinb merged commit a2bc976 into ThingPulse:master Jul 15, 2016
@FWeinb
Copy link
Collaborator

FWeinb commented Jul 15, 2016

Very good catch, thanks for fixing it!

@FWeinb FWeinb added this to the 3.2.4 milestone Jan 5, 2017
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.

2 participants