diff --git a/renderarea.cpp b/renderarea.cpp index 836c237..a970739 100644 --- a/renderarea.cpp +++ b/renderarea.cpp @@ -18,7 +18,7 @@ void RenderArea::paintEvent(QPaintEvent* event) painter.setRenderHint(QPainter::Antialiasing,true); painter.setBrush(mBackgroundColour); - painter.setPen(mShapeColour); + painter.setPen(mPen); painter.drawRect(this->rect()); @@ -50,9 +50,10 @@ void RenderArea::paintEvent(QPaintEvent* event) RenderArea::RenderArea(QWidget *parent) : QWidget{parent}, mBackgroundColour{36,35,35}, - mShapeColour{251,250,250}, + mPen{QColor{251,250,250}}, mShape{Astroid} { + mPen.setWidth(2); OnShapeChanged(); } diff --git a/renderarea.h b/renderarea.h index d420d6d..e50beb6 100644 --- a/renderarea.h +++ b/renderarea.h @@ -2,6 +2,7 @@ #define RENDERAREA_H #include +#include class RenderArea : public QWidget { @@ -27,8 +28,8 @@ class RenderArea : public QWidget void setBackgroundColor(QColor color) { mBackgroundColour = color; } QColor backgroundColor() const { return mBackgroundColour; } - void setShapeColor(QColor color) { mShapeColour = color; } - QColor shapeColor() const { return mShapeColour; } + void setShapeColor(QColor color) { mPen.setColor(color); } + QColor shapeColor() const { return mPen.color(); } void setShape(ShapesType shape) { mShape = shape; OnShapeChanged(); } ShapesType shape() const { return mShape; } @@ -61,8 +62,9 @@ class RenderArea : public QWidget QPointF ComputeEllipse(double t); QPointF ComputeFancy(double t); QPointF ComputeStarfish(double t); - QColor mBackgroundColour,mShapeColour; + QColor mBackgroundColour; ShapesType mShape; + QPen mPen; double mScale,mIntervalLenght; int mStepCount; };