Clean up rotation functions

This commit is contained in:
GriffinR
2022-10-13 15:14:53 -04:00
committed by Marcus Huderle
parent ad5eea2293
commit 47f6723bd2
4 changed files with 33 additions and 26 deletions

View File

@@ -44,15 +44,15 @@ public:
Q_INVOKABLE int getOpacity(int layer = 0);
Q_INVOKABLE void setOpacity(int opacity, int layer);
Q_INVOKABLE void setOpacity(int opacity);
Q_INVOKABLE int getHorizontalScale(int layer);
Q_INVOKABLE int getVerticalScale(int layer);
Q_INVOKABLE int getHorizontalScale(int layer = 0);
Q_INVOKABLE int getVerticalScale(int layer = 0);
Q_INVOKABLE void setHorizontalScale(int scale, int layer);
Q_INVOKABLE void setHorizontalScale(int scale);
Q_INVOKABLE void setVerticalScale(int scale, int layer);
Q_INVOKABLE void setVerticalScale(int scale);
Q_INVOKABLE int getRotation(int layer);
Q_INVOKABLE void setRotation(int rotation, int layer);
Q_INVOKABLE void setRotation(int rotation);
Q_INVOKABLE int getAngle(int layer = 0);
Q_INVOKABLE void setAngle(int angle, int layer);
Q_INVOKABLE void setAngle(int angle);
Q_INVOKABLE void rotate(int degrees, int layer);
Q_INVOKABLE void rotate(int degrees);
Q_INVOKABLE void addText(QString text, int x, int y, QString color = "#000000", int fontSize = 12, int layer = 0);

View File

@@ -70,7 +70,7 @@ public:
Overlay() {
this->x = 0;
this->y = 0;
this->rotation = 0;
this->angle = 0;
this->hScale = 1.0;
this->vScale = 1.0;
this->hidden = false;
@@ -92,8 +92,8 @@ public:
int getVScale();
void setHScale(int scale);
void setVScale(int scale);
int getRotation();
void setRotation(int rotation);
int getAngle();
void setAngle(int angle);
void rotate(int degrees);
void setClippingRect(QRectF rect);
void clearClippingRect();
@@ -108,11 +108,12 @@ public:
bool addImage(int x, int y, QImage image);
bool addPath(QList<int> xCoords, QList<int> yCoords, QString borderColorStr, QString fillColorStr);
private:
void clampAngle();
QColor getColor(QString colorStr);
QList<OverlayItem*> items;
int x;
int y;
int rotation;
int angle;
qreal hScale;
qreal vScale;
bool hidden;