Rename swap() to avoid clashes

Increment version
This commit is contained in:
Bodmer
2017-04-13 00:20:19 +01:00
parent cb1fb31e13
commit e65f4cb1fe
4 changed files with 16 additions and 16 deletions

View File

@@ -916,13 +916,13 @@ void TFT_eSPI::fillTriangle ( int32_t x0, int32_t y0, int32_t x1, int32_t y1, in
// Sort coordinates by Y order (y2 >= y1 >= y0) // Sort coordinates by Y order (y2 >= y1 >= y0)
if (y0 > y1) { if (y0 > y1) {
swap(y0, y1); swap(x0, x1); swap_coord(y0, y1); swap_coord(x0, x1);
} }
if (y1 > y2) { if (y1 > y2) {
swap(y2, y1); swap(x2, x1); swap_coord(y2, y1); swap_coord(x2, x1);
} }
if (y0 > y1) { if (y0 > y1) {
swap(y0, y1); swap(x0, x1); swap_coord(y0, y1); swap_coord(x0, x1);
} }
if (y0 == y2) { // Handle awkward all-on-same-line case as its own thing if (y0 == y2) { // Handle awkward all-on-same-line case as its own thing
@@ -960,7 +960,7 @@ void TFT_eSPI::fillTriangle ( int32_t x0, int32_t y0, int32_t x1, int32_t y1, in
sa += dx01; sa += dx01;
sb += dx02; sb += dx02;
if (a > b) swap(a, b); if (a > b) swap_coord(a, b);
drawFastHLine(a, y, b - a + 1, color); drawFastHLine(a, y, b - a + 1, color);
} }
@@ -974,7 +974,7 @@ void TFT_eSPI::fillTriangle ( int32_t x0, int32_t y0, int32_t x1, int32_t y1, in
sa += dx12; sa += dx12;
sb += dx02; sb += dx02;
if (a > b) swap(a, b); if (a > b) swap_coord(a, b);
drawFastHLine(a, y, b - a + 1, color); drawFastHLine(a, y, b - a + 1, color);
} }
} }
@@ -2309,13 +2309,13 @@ void TFT_eSPI::drawLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint32_t
boolean steep = abs(y1 - y0) > abs(x1 - x0); boolean steep = abs(y1 - y0) > abs(x1 - x0);
if (steep) { if (steep) {
swap(x0, y0); swap_coord(x0, y0);
swap(x1, y1); swap_coord(x1, y1);
} }
if (x0 > x1) { if (x0 > x1) {
swap(x0, x1); swap_coord(x0, x1);
swap(y0, y1); swap_coord(y0, y1);
} }
int32_t dx = x1 - x0, dy = abs(y1 - y0);; int32_t dx = x1 - x0, dy = abs(y1 - y0);;
@@ -2364,13 +2364,13 @@ void TFT_eSPI::drawLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint32_t
boolean steep = abs(y1 - y0) > abs(x1 - x0); boolean steep = abs(y1 - y0) > abs(x1 - x0);
if (steep) { if (steep) {
swap(x0, y0); swap_coord(x0, y0);
swap(x1, y1); swap_coord(x1, y1);
} }
if (x0 > x1) { if (x0 > x1) {
swap(x0, x1); swap_coord(x0, x1);
swap(y0, y1); swap_coord(y0, y1);
} }
if (x1 < 0) return; if (x1 < 0) return;

View File

@@ -213,7 +213,7 @@
// Swap any type // Swap any type
template <typename T> static inline void template <typename T> static inline void
swap(T& a, T& b) { T t = a; a = b; b = t; } swap_coord(T& a, T& b) { T t = a; a = b; b = t; }
// This is a structure to conveniently hold infomation on the default fonts // This is a structure to conveniently hold infomation on the default fonts
// Stores pointer to font character image address table, width table and height // Stores pointer to font character image address table, width table and height

View File

@@ -1,6 +1,6 @@
{ {
"name": "TFT_eSPI", "name": "TFT_eSPI",
"version": "0.16.0", "version": "0.16.1",
"keywords": "ILI9341, ST7735, ESP8266, TFT", "keywords": "ILI9341, ST7735, ESP8266, TFT",
"description": "A TFT SPI graphics library for ESP8266", "description": "A TFT SPI graphics library for ESP8266",
"repository": "repository":

View File

@@ -1,5 +1,5 @@
name=TFT_eSPI name=TFT_eSPI
version=0.16 version=0.16.1
author=Bodmer author=Bodmer
maintainer=Bodmer maintainer=Bodmer
sentence=A fast TFT library for ESP8266 processors and the Arduino IDE sentence=A fast TFT library for ESP8266 processors and the Arduino IDE