mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-19 23:00:34 +02:00
Ran Uncrustify Again
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user