Ran Uncrustify Again

This commit is contained in:
2020-01-09 10:18:28 +01:00
parent ee64fa6997
commit d4313e29a0
21 changed files with 428 additions and 428 deletions

View File

@@ -97,7 +97,7 @@ void IntelliPhotoGui::slotDeleteLayer(){
tr("Number:"),
paintingArea->getNumberOfActiveLayer(),0, 500, 1, &ok);
// Create New Layer
if (ok){
if (ok) {
paintingArea->deleteLayer(layerNumber);
UpdateGui();
}
@@ -259,12 +259,12 @@ void IntelliPhotoGui::slotAboutDialog(){
void IntelliPhotoGui::slotEnterPressed(){
QString string = EditLineWidth->text();
if(string.toInt() > 50){
if(string.toInt() > 50) {
EditLineWidth->setText("50");
}
paintingArea->Toolsettings.setLineWidth(string.toInt());
string = EditLineInnerAlpha->text();
if(string.toInt() > 255){
if(string.toInt() > 255) {
EditLineInnerAlpha->setText("255");
}
paintingArea->Toolsettings.setInnerAlpha(string.toInt());

View File

@@ -5,16 +5,16 @@
class IntelliRenderSettings
{
public:
IntelliRenderSettings();
IntelliRenderSettings();
/*!
/*!
* \brief The getfastRenderer gets the value of the flag for the fastRenderer setting.
* \return Returns true if fastRenderer is active else false
*/
bool getFastRenderer();
bool getFastRenderer();
private:
bool fastRenderer = true;
bool fastRenderer = true;
};
#endif // INTELLIRENDERSETTINGS_H

View File

@@ -21,10 +21,10 @@ void IntelliToolsettings::setLineWidth(){
}
void IntelliToolsettings::setLineWidth(int LineWidth){
if(LineWidth < 1){
if(LineWidth < 1) {
LineWidth = 1;
}
else if(LineWidth > 50){
else if(LineWidth > 50) {
LineWidth = 50;
}
lineWidth = LineWidth;
@@ -39,10 +39,10 @@ void IntelliToolsettings::setInnerAlpha(){
}
void IntelliToolsettings::setInnerAlpha(int innerAlpha){
if(innerAlpha < 0){
if(innerAlpha < 0) {
innerAlpha = 0;
}
else if(innerAlpha > 255){
else if(innerAlpha > 255) {
innerAlpha = 255;
}
this->innerAlpha = innerAlpha;

View File

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

View File

@@ -146,8 +146,8 @@ void PaintingArea::floodFill(int r, int g, int b, int a){
}
void PaintingArea::movePositionActive(int x, int y){
if(Tool!=nullptr){
if(Tool->getIsDrawing()){
if(Tool!=nullptr) {
if(Tool->getIsDrawing()) {
IntelliTool* temp = copyActiveTool();
delete this->Tool;
this->Tool = temp;
@@ -158,7 +158,7 @@ void PaintingArea::movePositionActive(int x, int y){
}
void PaintingArea::moveActiveLayer(int idx){
if(Tool->getIsDrawing()){
if(Tool->getIsDrawing()) {
IntelliTool* temp = copyActiveTool();
delete this->Tool;
this->Tool = temp;
@@ -171,8 +171,8 @@ void PaintingArea::moveActiveLayer(int idx){
}
void PaintingArea::slotActivateLayer(int a){
if(Tool != nullptr){
if(Tool->getIsDrawing()){
if(Tool != nullptr) {
if(Tool->getIsDrawing()) {
IntelliTool* temp = copyActiveTool();
delete this->Tool;
this->Tool = temp;
@@ -290,7 +290,7 @@ void PaintingArea::mouseReleaseEvent(QMouseEvent*event){
}
void PaintingArea::wheelEvent(QWheelEvent*event){
if(this->Tool != nullptr){
if(this->Tool != nullptr) {
QPoint numDegrees = event->angleDelta() / 8;
if(!numDegrees.isNull()) {
QPoint numSteps = numDegrees / 15;
@@ -385,7 +385,7 @@ void PaintingArea::createTempTopLayer(int idx){
}
IntelliTool* PaintingArea::copyActiveTool(){
switch(Tool->getTooltype()){
switch(Tool->getTooltype()) {
case IntelliTool::Tooltype::CIRCLE: return new IntelliToolCircle(this,&colorPicker, &Toolsettings);
case IntelliTool::Tooltype::FLOODFILL: return new IntelliToolFloodFill(this,&colorPicker, &Toolsettings);
case IntelliTool::Tooltype::LINE: return new IntelliToolLine(this,&colorPicker, &Toolsettings);

View File

@@ -13,7 +13,7 @@ class PaintingArea;
*/
class IntelliTool {
public:
enum class Tooltype{
enum class Tooltype {
CIRCLE,
FLOODFILL,
LINE,
@@ -21,7 +21,7 @@ public:
PLAIN,
POLYGON,
RECTANGLE
};
};
private:
/*!
* \brief A function that creates a layer to draw on.

View File

@@ -13,18 +13,18 @@ IntelliToolPolygon::IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* c
}
IntelliToolPolygon::~IntelliToolPolygon(){
if(isDrawing){
if(isDrawing) {
IntelliTool::onMouseRightPressed(0,0);
}
}
void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
if(!isDrawing && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()){
if(!isDrawing && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(Area->getPolygonDataOfRealLayer());
QPoint Point(x,y);
isInside = IntelliTriangulation::isInPolygon(Triangles,Point);
}
else if(!isDrawing && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::RASTERIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()){
else if(!isDrawing && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::RASTERIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
isInside = true;
}
@@ -39,7 +39,7 @@ void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
this->Canvas->image->calculateVisiblity();
}
else if(isDrawing && isNearStart(x,y,QPointList.front())) {
if(QPointList.size() > 2){
if(QPointList.size() > 2) {
isPointNearStart = true;
this->Canvas->image->drawLine(QPointList.back(), QPointList.front(), colorPicker->getFirstColor(), Toolsettings->getLineWidth());
this->Canvas->image->calculateVisiblity();