Change struct parameter to pass by reference.

This commit is contained in:
tko 2024-03-01 12:19:41 +01:00
parent deb2029394
commit a9b9bd69f1
2 changed files with 8 additions and 8 deletions

View File

@ -52,9 +52,9 @@ void TFT_eSPI::rotatePoint(tFPoint *aPoint, float aAngle) {
//--------------------------------------------------------------------------------
// Rotation in degrees (0..360)
void TFT_eSPI::fillSmoothPolygon(tFPoints aPoints, float aLineWidth, uint32_t aLineColor,
void TFT_eSPI::fillSmoothPolygon(const tFPoints aPoints, float aLineWidth, uint32_t aLineColor,
uint32_t aFillColor,
tFPoint aOffset, float aRotationAngle, tFPoint aRotationPoint,
const tFPoint aOffset, float aRotationAngle, const tFPoint aRotationPoint,
uint32_t aBackgroundColor) {
tFPoints lPoints = aPoints;
@ -178,8 +178,8 @@ void TFT_eSPI::fillSmoothPolygon(tFPoints aPoints, float aLineWidth, uint32_t aL
//--------------------------------------------------------------------------------
// Rotation in degrees (0..360)
void TFT_eSPI::drawSmoothPolygon(tFPoints aPoints, float aLineWidth, uint32_t aLineColor,
tFPoint aOffset, float aRotationAngle, tFPoint aRotationPoint,
void TFT_eSPI::drawSmoothPolygon(const tFPoints aPoints, float aLineWidth, uint32_t aLineColor,
const tFPoint aOffset, float aRotationAngle, const tFPoint aRotationPoint,
uint32_t aBackgroundColor) {
fillSmoothPolygon(aPoints, aLineWidth, aLineColor, TFT_NO_COLOR, aOffset, aRotationAngle, aRotationPoint, aBackgroundColor);

View File

@ -10,12 +10,12 @@ public:
typedef std::vector<tFPoint> tFPoints;
void rotatePoint(tFPoint *aPoint, float aAngle);
void drawSmoothPolygon(tFPoints aPoints, float aLineWidth, uint32_t aLineColor,
tFPoint aOffset = {0, 0}, float aRotationAngle = 0.0, tFPoint aRotationPoint = {0, 0},
void drawSmoothPolygon(const tFPoints aPoints, float aLineWidth, uint32_t aLineColor,
const tFPoint aOffset = {0, 0}, float aRotationAngle = 0.0, const tFPoint aRotationPoint = {0, 0},
uint32_t aBackgroundColor = TFT_NO_COLOR);
void fillSmoothPolygon(tFPoints aPoints, float aLineWidth, uint32_t aLineColor,
void fillSmoothPolygon(const tFPoints aPoints, float aLineWidth, uint32_t aLineColor,
uint32_t aFillColor = TFT_NO_COLOR,
tFPoint aOffset = {0, 0}, float aRotationAngle = 0.0, tFPoint aRotationPoint = {0, 0},
const tFPoint aOffset = {0, 0}, float aRotationAngle = 0.0, const tFPoint aRotationPoint = {0, 0},
uint32_t aBackgroundColor = TFT_NO_COLOR);
private: