Add rotated rectangle draw and fill methods - #489
Conversation
|
@ladyada for review. |
|
thanks! please also add some example to test this code, maybe displaying rotating rectangles - so we can easily verify functionality on platforms/displays :) |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for drawing rotated rectangles to the Adafruit GFX library. The implementation includes functions to draw outlined rotated rectangles, filled rotated rectangles, and a helper function to rotate points around an origin.
- Adds
drawRotatedRectangleandfillRotatedRectanglemethods for rendering rotated rectangles - Implements a
rotatePointhelper function for coordinate rotation - Uses trigonometric functions to rotate rectangle corners and existing drawing primitives (lines and triangles) for rendering
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Adafruit_GFX.h | Adds method declarations for the three new rotated rectangle functions |
| Adafruit_GFX.cpp | Implements the rotated rectangle drawing logic with supporting rotation math |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Wasn't sure where you wanted an example, so I placed one in the 'examples' directory in a directory called 'RotatedRectangleTest'. Commented the display-specific code. |
|
@ladyada for review. |
…llMerryman/Adafruit-GFX-Library-For-Animation into Add_rotated_rectangle_methods
These methods implement the ability to draw and fill rectangles rotated by a given angle in degrees.