mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-14 20:30:32 +02:00
Removed Linestyle from the project
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user