Removed Linestyle from the project

This commit is contained in:
2020-01-15 12:01:17 +01:00
parent c4467b70b8
commit af5a05faf8
4 changed files with 3 additions and 28 deletions

View File

@@ -4,8 +4,7 @@
IntelliToolsettings::IntelliToolsettings()
{
lineWidth = 1;
innerAlpha = 255;
Linestyle = LineStyle::SOLID_LINE;
innerAlpha = 255;
}
IntelliToolsettings::~IntelliToolsettings(){
@@ -47,7 +46,3 @@ void IntelliToolsettings::setInnerAlpha(int innerAlpha){
}
this->innerAlpha = innerAlpha;
}
IntelliToolsettings::LineStyle IntelliToolsettings::getLinestyle(){
return Linestyle;
}

View File

@@ -3,13 +3,6 @@
class IntelliToolsettings {
public:
/*!
* \brief The LineStyle enum classifing all ways of drawing a line.
*/
enum class LineStyle {
SOLID_LINE,
DOTTED_LINE
};
IntelliToolsettings();
virtual ~IntelliToolsettings();
int getLineWidth();
@@ -18,12 +11,10 @@ void setLineWidth(int LineWidth);
int getInnerAlpha();
void setInnerAlpha();
void setInnerAlpha(int innerAlpha);
LineStyle getLinestyle();
private:
int lineWidth;
int innerAlpha;
LineStyle Linestyle;
};
#endif

View File

@@ -40,18 +40,7 @@ void IntelliToolLine::onMouseMoved(int x, int y){
if(this->isDrawing) {
this->Canvas->image->drawPlain(Qt::transparent);
QPoint next(x,y);
switch(Toolsettings->getLinestyle()) {
case IntelliToolsettings::LineStyle::SOLID_LINE:
this->Canvas->image->drawLine(lineStartingPoint,next,colorPicker->getFirstColor(),Toolsettings->getLineWidth());
break;
case IntelliToolsettings::LineStyle::DOTTED_LINE:
QPoint p1 =lineStartingPoint.x() <= next.x() ? lineStartingPoint : next;
QPoint p2 =lineStartingPoint.x() < next.x() ? next : lineStartingPoint;
int m = static_cast<int>(static_cast<float>(p2.y()-p1.y())/static_cast<float>(p2.x()-p1.x())+0.5f);
int c = lineStartingPoint.y()-lineStartingPoint.x()*m;
//TODO implement dotted algorithm
break;
}
this->Canvas->image->drawLine(lineStartingPoint,next,colorPicker->getFirstColor(),Toolsettings->getLineWidth());
}
IntelliTool::onMouseMoved(x,y);
}

View File

@@ -16,7 +16,7 @@ QPoint lineStartingPoint;
public:
/*!
* \brief A constructor setting the general paintingArea and colorPicker. And reading in the lineWidth and lineStyle.
* \brief A constructor setting the general paintingArea and colorPicker.
* \param Area - The general paintingArea used by the project.
* \param colorPicker - The general colorPicker used by the project.
*/