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

drawCircle() and drawDisk artifacts if used with inverse drawing #2480

Closed
DatBlaueHus opened this issue Jul 23, 2024 · 3 comments
Closed

drawCircle() and drawDisk artifacts if used with inverse drawing #2480

DatBlaueHus opened this issue Jul 23, 2024 · 3 comments
Labels
Milestone

Comments

@DatBlaueHus
Copy link

DatBlaueHus commented Jul 23, 2024

If using draw Circle with inverse Drawing, I get some artifacts, both the lines and the discs expose dark lines crossing them, looks like an off-by-one error to me.

Code to reproduce:

#include <U8g2lib.h>
#include <Wire.h>

//Choose the driver according to memory requirements
// U8G2_SSD1306_128X64_NONAME_1_HW_I2C display(U8G2_R2, /* reset=*/ U8X8_PIN_NONE); //small buffer
U8G2_SSD1306_128X64_NONAME_2_HW_I2C display(U8G2_R2, /* reset=*/ U8X8_PIN_NONE); // big buffer
//U8G2_SSD1306_128X64_NONAME_F_HW_I2C display(U8G2_R2, /* reset=*/ U8X8_PIN_NONE); // Fullscreen

void setup() {
  display.begin();
  drawOnce();  
}

void drawOnce() {
  display.firstPage();
  do {     //page looping
    display.setDrawColor(1);
    display.drawBox(8, 8, 102, 102);
    display.setDrawColor(2);
    display.drawCircle(91, 29, 20);
    display.drawDisc(91, 29, 16);
    display.drawCircle(120, 32, 8);
    display.drawDisc(120, 32, 4);
  } while ( display.nextPage() );
}

void loop() {
}

It works fine if you drawCircle() and drawDisc() with drawColor 1, and invert the box.

@DatBlaueHus DatBlaueHus changed the title drawCircle() artifacts if used with inverse drawing drawCircle() and drawDisk artifacts if used with inverse drawing Jul 23, 2024
@olikraus olikraus added the bug label Aug 18, 2024
@olikraus olikraus added this to the 2.35 milestone Aug 18, 2024
@olikraus
Copy link
Owner

marked as a bug for now... I need to find some time to look into this... Thanks for reporting this.

@olikraus
Copy link
Owner

olikraus commented Aug 29, 2024

The problem is the DrawColor(2). This is not supported. See here: https://github.com/olikraus/u8g2/wiki/u8g2reference#drawdisc

Actually you can only use colors 0 and 1

@olikraus olikraus added question and removed bug labels Sep 1, 2024
@olikraus
Copy link
Owner

olikraus commented Sep 1, 2024

no further feedback, closing...

@olikraus olikraus closed this as completed Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants