Using tft.FillTriangle() in Adafruit TFTLCD library:
Problem:
We are using left and right facing triangles as decrement/increment buttons.
Cannot fill a right facing triangle after calling tft.FillTriangle().
Most of the display will fill instead.
Drawing the triangle works fine.
Left facing triangles will fill fine no matter where they are placed on the display
Code Snippet:
//Draw and Fill Right advance button
tft.drawTriangle(tft.width()/10, tft.height()/10+6*i,
tft.width()/10-i, tft.height()/10+4*i,
tft.width()/10+i, tft.height()/10+4*i, BLACK);
tft.fillTriangle(tft.width()/10, tft.height()/10+6*i,
tft.width()/10-i, tft.height()/10+4*i,
tft.width()/10+i, tft.height()/10+4*i, BLACK);
Any Ideas?
ARDUINO UNO w/Adafruit 2.8" TFTLCD
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 3
- Joined: Wed Nov 09, 2011 8:52 pm
ARDUINO UNO w/Adafruit 2.8" TFTLCD
- Attachments
-
- Noname.jpg (15.31 KiB) Viewed 681 times
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: ARDUINO UNO w/Adafruit 2.8" TFTLCD
Hmmm. Sounds like a bug in the fill algorithm. Does it make a difference if you specify the vertices in clockwise vs. counter-clockwise order?
Please be positive and constructive with your questions and comments.