Commit Graph
106 Commits
Author SHA1 Message Date
BillMerrymanandGitHub c5f9fb14f1 Add drawRotatedRect and fillRotatedRect methods (#508)
* Add drawRotatedRect and fillRotatedRect methods

* Corrected docs
2026-04-01 10:21:37 -04:00
BillMerrymanandGitHub 20abf158a1 Correct circle method docs (#487) 2025-11-07 14:26:52 -05:00
DS-Aditya-928andGitHub 4c89798ccd Optimise fillEllipse function. ~36% faster (#478)
* Optimised fillEllipse function

* Cleaned up code
2025-09-17 12:08:09 -04:00
DS-Aditya-928andGitHub 32da3d2094 Added drawEllipse and fillEllipse functions (#477)
* Added drawEllipse and fillEllipse functions

* Formatting fixes
2025-09-14 08:28:20 -04:00
Jeff EplerandGitHub f80daa51c9 GFXcanvas: Allow subclass to take charge of buffer allocations (#465)
* GFXcanvas: Allow subclass to take charge of buffer allocations

In Adafruit_dvhstx, the low level driver takes charge of the framebuffer
allocations. Consequently, any allocation by the GFXcanvas class would be
an unused waste of memory.

Introduce a new constructor parameter `bool allocate_buffer=true`. The
default preserves the old behavior of allocating the buffer in the
constructor and freeing it in the destructor, while passing in `false`
skips buffer allocation & freeing.

In this case, the subclass must allocate the buffer before the first
drawing operation (such as in its constructor or begin method), and
free it in its own destructor or end method.

The subclass can also freely change the buffer pointer at runtime, for
instance in a swap method if the underlying framebuffer is double-buffered.

* experimentally run a different clang-format

This runs version 19.1.7: uvx clang-format -i *.cpp *.h

the changes look similar to what was shown during CI

* undo one edit that ci doesn't like
2025-02-19 10:15:01 -05:00
Phillip Burgess 5ea4be3ffe Fix bug w/large GFXcanvas1's (use 32-bit byte counts) 2023-01-18 14:53:07 -08:00
Wayne Piekarski c341c18f7a Fixes -Wshadow "error: declaration of 'byte' shadows a global declaration"
Arduino.h defines "typedef uint8_t byte" that conflicts with this declaration
2022-06-22 09:33:21 -07:00
Wayne Piekarski f8e9621bad Fixes -Wshadow "error: declaration of 'buffer' shadows a member of 'GFXcanvas1'"
No need to declare local buffer variable for getBuffer() since it already exists.
2022-06-22 09:32:00 -07:00
Melissa LeBlanc-WilliamsandGitHub 605ea88e40 Revert "Speed up internal font drawing for opaque background color" 2022-03-16 11:51:38 -07:00
Laurence Bank 77d05f5ab5 Attempt to fix doxygen errors 2022-03-09 11:52:32 +00:00
Laurence Bank c035859fcc ran clang-format 2022-03-09 11:19:00 +00:00
Laurence Bank a8f1bd54bb missed removing one more #ifdef 2022-03-08 17:28:04 +00:00
Laurence Bank 8bab5dba75 revered AVR exclusions 2022-03-08 17:18:26 +00:00
Laurence Bank 99c324d33e second attempt to stop AVR build from messing things up for everyone else 2022-03-08 15:55:52 +00:00
Laurence Bank 14fd8ab168 disabled change for AVR targets 2022-03-08 15:42:34 +00:00
Laurence Bank 9ac47e8616 Sped up internal font drawing for opaque background color 2022-03-08 14:38:41 +00:00
Phillip Burgess 0b6068e833 clang-format fix 2021-09-06 21:38:47 -07:00
Robert Wolff 7e596016cd Dangerous edge case for non-null-terminated string
strncpy() does not place a null terminator when the max characters is reached of '9' in this case. So, any buttons with 9 or more in the source will wind up with a potentially non-null-terminated _label.
2021-05-07 14:12:16 -07:00
Brian ParkandGitHub 58606c5701 Fix -Wunused-parameter warnings (#328) 2020-12-08 17:37:27 -05:00
KurtEandGitHub 6c648c6d68 Fix GFXcanvas16::drawFastRawHLine (#326)
This is a quick fix to fix functions like:
```
GFXcanvas16 *canvas = new GFXcanvas16 (240, 320)
canvas -> fillTriangle(0, 0, 239, 0, 120, 310, ILI9341_BLUE)
```
Could all on down to drawFastRawHLine and the
computerd buffer_index > 32767 which is the largest that could be held in int16_t.  So switched to uint32_t also converted the computed value to uint32_t as well as to remove compiler warning.

Removed another compiler warning as well.

This addresses the problem in
#325
2020-11-21 12:11:50 -05:00
Phillip Burgess 1459233d38 clang-format fix 2020-10-19 12:16:15 -07:00
Phillip Burgess f876b1360c Fix clipping in fast H/V lines on canvases 2020-10-19 12:00:55 -07:00
Michael Kamprath c9d7f3cccc added method documentation 2020-08-18 23:05:17 -07:00
Michael Kamprath 18eec8bb9e fixed fast line drawing in GFXcanvas* classes 2020-08-18 22:25:19 -07:00
Melissa LeBlanc-WilliamsandGitHub e4fcdba2b2 Merge pull request #237 from michaelkamprath/master
Added support in GFXcanvas* classes to access pixel values
2020-06-16 16:02:58 -07:00
nuxehandGitHub e806c84d3f Change boolean to bool (#303)
* Change boolean to bool

This avoids compiler warnings such as:

    In file included from /home/ed/git/dryer-arduino/ui/src/graphicstest.ino:18:
    .pio/libdeps/nucleo_f446re/Adafruit GFX Library_ID13/Adafruit_GFX.h:48:39: warning: 'boolean' is deprecated [-Wdeprecated-declarations]
       48 |   virtual void invertDisplay(boolean i);
          |                                       ^
    In file included from /home/ed/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:34,
                     from /home/ed/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:32,
                     from /tmp/tmpvslwxjr7:1:
    /home/ed/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_constants.h:110:14: note: declared here

* Fix clang format issues unrelated to this PR

Addresses the following from CI:

    $ python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
    --- ./Adafruit_GFX.h	(original)
    +++ ./Adafruit_GFX.h	(reformatted)
    @@ -240,8 +240,8 @@
       uint8_t textsize_x;   ///< Desired magnification in X-axis of text to print()
       uint8_t textsize_y;   ///< Desired magnification in Y-axis of text to print()
       uint8_t rotation;     ///< Display rotation (0 thru 3)
    -  bool wrap;         ///< If set, 'wrap' text at right edge of display
    -  bool _cp437;       ///< If set, use correct CP437 charset (default is off)
    +  bool wrap;            ///< If set, 'wrap' text at right edge of display
    +  bool _cp437;          ///< If set, use correct CP437 charset (default is off)
       GFXfont *gfxFont;     ///< Pointer to special font
     };

    --- ./Adafruit_GFX.cpp	(original)
    +++ ./Adafruit_GFX.cpp	(reformatted)
    @@ -1713,9 +1713,7 @@
        @returns  True if was pressed before, now is not.
     */
     /**************************************************************************/
    -bool Adafruit_GFX_Button::justReleased() {
    -  return (!currstate && laststate);
    -}
    +bool Adafruit_GFX_Button::justReleased() { return (!currstate && laststate); }

     // -------------------------------------------------------------------------
2020-06-15 11:20:29 -04:00
Melissa LeBlanc-WilliamsandGitHub 8be8308f03 Revert "Optimized drawChar and drawCircleHelper" 2020-06-08 10:05:48 -07:00
Laurence Bank 632cf443a8 Reformatted with clang-format 2020-06-07 12:32:37 -04:00
Laurence Bank e1e51b09e1 pr cleanup 2020-06-07 10:11:36 -04:00
Laurence Bank 1b93789997 Optimized drwChar and drawCircleHelper 2020-06-06 18:51:57 -04:00
Michael Kamprath 6791eaca01 Re-running clang-format after the rebase 2020-06-05 11:00:20 -07:00
Michael Kamprath c53e9d24aa added support in GFXcanvas* classes to access pixel values
Alsp added and example for GFXcanvas that demonstrates the impact of rotation
on pixel layout and also demonstrates getting a pixel based on raw
physical coordinates.
2020-06-05 10:52:32 -07:00
lady ada d2b4b25559 manual implementation of https://github.com/adafruit/Adafruit-GFX-Library/pull/282 2020-05-17 12:35:25 -04:00
Limor "Ladyada" FriedandGitHub 6abf693056 Actionsci2 (#264)
add library dependancy
remove travis CI
update badge
enable Actions
2019-12-27 17:10:08 -05:00
Melissa LeBlanc-Williams 4a161f1e00 Merge branch 'master' of https://github.com/adafruit/Adafruit-GFX-Library 2019-06-12 14:00:37 -07:00
Melissa LeBlanc-WilliamsandGitHub 60e0e6335f Revert "Revert "Text magnification factor can be defined separately for X and for Y axis"" 2019-06-12 13:53:17 -07:00
Melissa LeBlanc-WilliamsandGitHub 988f73af04 Revert "Text magnification factor can be defined separately for X and for Y axis" 2019-06-12 13:47:08 -07:00
jonnieZG 098fa70aae Fixed @param argument documentation 2019-06-12 22:11:21 +02:00
jonnieZG 022e8920cc Text magnification factor can be defined separately for X and for Y axis level. It allows you to print "tall" or "wide" text. 2019-06-12 20:31:45 +02:00
Oleksandr Masliuchenko 7c26ed40f5 Fix indentation (tab vs spaces) 2019-06-07 09:21:25 +03:00
Oleksandr Masliuchenko 50c1a22d20 Re-apply warning fix patch 2019-06-07 09:09:30 +03:00
Phillip Burgess b0dc94def7 Inline some of the trivial functions, add byteSwap() for GFXcanvas16 2019-05-29 20:33:31 -07:00
Calvin HassandGitHub 37ac3a5b52 Fix overflow in fillTriangle()
Addresses integer overflow fix identified by @prenticedavid in https://github.com/adafruit/Adafruit-GFX-Library/issues/218
2019-05-09 08:26:37 -07:00
Marc MERLINandLimor "Ladyada" Fried 85023ccbaf Fixed Height typo (#214) 2019-04-29 13:24:18 -04:00
Phillip Burgess d81e3351f3 Fix some ESP8266 batshittery 2019-03-01 13:38:18 -08:00
Phillip Burgess 03cf2d917e Round rects; limit radius to 1/2 minor axis 2018-11-26 13:41:26 -08:00
Phillip Burgess 0521944f9f Fix fillCircleHelper for SSD1306 INVERT mode
Function would previously draw certain line segments repeatedly; minor performance drain on most displays, but especially problematic for SSD1306's INVERT drawing mode.
2018-11-08 15:01:27 -08:00
Limor "Ladyada" FriedandGitHub f379d7070c Merge pull request #130 from vortigont/dev
Added String overload to getTextBounds() #90
2018-08-10 08:37:32 -07:00
Ville Karaila 675c972170 Added a cast to int_16 since height and width are uint_16s.
Note: Consider harmonizing types since uints might spill if someone
invents a 64k wide or high oled.. Jk. Changing h and w might be nice
tho, but keeping changes at minimum here.
2018-08-08 16:53:58 -07:00
Emil Muratov 15344e4ff9 Add doxygen for getTextBounds()
Signed-off-by: Emil Muratov <gpm@hotplug.ru>
2018-08-09 00:06:59 +03:00