From 736ca69245b89ec0af12b120a3277725f095fe9c Mon Sep 17 00:00:00 2001 From: Jonas Mucke Date: Thu, 9 Jan 2020 20:09:40 +0100 Subject: [PATCH] warning fixen and better circle --- src/GUI/IntelliPhotoGui.cpp | 5 ++--- src/Layer/PaintingArea.cpp | 6 ++++-- src/Tool/IntelliToolCircle.cpp | 3 +-- src/Tool/IntelliToolLine.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index d73a730..b3c03cc 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -78,9 +78,8 @@ void IntelliPhotoGui::slotCreateNewLayer(){ tr("Height:"), 200,1, 500, 1, &ok2); // Create New Layer - if (ok1&&ok2) - { - int layer = paintingArea->addLayer(width,height,0,0); + if (ok1&&ok2){ + paintingArea->addLayer(width,height,0,0); UpdateGui(); } } diff --git a/src/Layer/PaintingArea.cpp b/src/Layer/PaintingArea.cpp index a2df96d..779c2bb 100644 --- a/src/Layer/PaintingArea.cpp +++ b/src/Layer/PaintingArea.cpp @@ -265,8 +265,9 @@ std::vector PaintingArea::getPolygonDataOfRealLayer(){ // left button and if so store the current position // Set that we are currently drawing void PaintingArea::mousePressEvent(QMouseEvent*event){ - if(this->activeLayer < 0) + if(this->activeLayer < 0){ return; + } if(Tool == nullptr) return; int x = event->x()-layerBundle[static_cast(activeLayer)].widthOffset; @@ -283,8 +284,9 @@ void PaintingArea::mousePressEvent(QMouseEvent*event){ // we call the drawline function which draws a line // from the last position to the current void PaintingArea::mouseMoveEvent(QMouseEvent*event){ - if(this->activeLayer < 0) + if(this->activeLayer < 0){ return; + } if(Tool == nullptr) return; int x = event->x()-layerBundle[static_cast(activeLayer)].widthOffset; diff --git a/src/Tool/IntelliToolCircle.cpp b/src/Tool/IntelliToolCircle.cpp index eba6736..cde5da6 100644 --- a/src/Tool/IntelliToolCircle.cpp +++ b/src/Tool/IntelliToolCircle.cpp @@ -13,7 +13,6 @@ IntelliToolCircle::~IntelliToolCircle(){ } void IntelliToolCircle::drawCircle(int radius){ - int outer = radius+20; QColor inner = this->colorPicker->getSecondColor(); inner.setAlpha(Toolsettings->getInnerAlpha()); int yMin, yMax, xMin, xMax; @@ -27,7 +26,7 @@ void IntelliToolCircle::drawCircle(int radius){ } //TODO implement circle drawing algorithm bresenham - radius = static_cast(radius +(Toolsettings->getLineWidth()/2.)-1.); + radius = static_cast(radius +(Toolsettings->getLineWidth()/2.)); yMin = (centerPoint.y()-radius); yMax = (centerPoint.y()+radius); for(int i=yMin; i<=yMax; i++) { diff --git a/src/Tool/IntelliToolLine.cpp b/src/Tool/IntelliToolLine.cpp index 97daa85..45194de 100644 --- a/src/Tool/IntelliToolLine.cpp +++ b/src/Tool/IntelliToolLine.cpp @@ -49,7 +49,7 @@ void IntelliToolLine::onMouseMoved(int x, int y){ QPoint p2 =lineStartingPoint.x() < next.x() ? next : lineStartingPoint; int m = static_cast(static_cast(p2.y()-p1.y())/static_cast(p2.x()-p1.x())+0.5f); int c = lineStartingPoint.y()-lineStartingPoint.x()*m; - + //TODO implement dotted algorithm break; } }