removed some warnings

This commit is contained in:
Jan Schuffenhauer
2020-02-07 16:47:12 +01:00
parent 6d09b12b98
commit 81c15f84b9
4 changed files with 19 additions and 17 deletions

View File

@@ -88,7 +88,7 @@ std::vector<Triangle> IntelliTriangulation::calculateTriangles(std::vector<QPoin
}
// update post und prev idx
post = getPrev(post, Vertices.size());
post = static_cast<int>(getPrev(post, Vertices.size()));
prev = prev<smallest.idx ? prev : (prev - 1);
// calcultae neighboors of prev and post to calculate new interior angles

View File

@@ -37,10 +37,10 @@ LayerObject::LayerObject(const LayerObject& layer){
this->alpha = layer.alpha;
}
PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget*parent)
PaintingArea::PaintingArea(int newMaxWidth, int newMaxHeight, QWidget*parent)
: QLabel(parent){
this->Tool = nullptr;
this->setCanvasDimensions(maxWidth, maxHeight);
this->setCanvasDimensions(newMaxWidth, newMaxHeight);
activeLayer = -1;
}
@@ -69,10 +69,10 @@ bool PaintingArea::getRenderSettings(){
return this->renderSettings.isFastRenderering();
}
void PaintingArea::setCanvasDimensions(int maxWidth, int maxHeight){
void PaintingArea::setCanvasDimensions(int newMaxWidth, int newMaxHeight){
//set standart parameter
this->maxWidth = maxWidth;
this->maxHeight = maxHeight;
this->maxWidth = newMaxWidth;
this->maxHeight = newMaxHeight;
Canvas = new QImage(maxWidth,maxHeight, QImage::Format_ARGB32);
this->offsetXDimension = maxWidth / 2;
@@ -453,12 +453,14 @@ IntelliTool* PaintingArea::copyActiveTool(){
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::GRADIENT: return new IntelliToolGradient(this,&colorPicker, &Toolsettings);
case IntelliTool::Tooltype::LINE: return new IntelliToolLine(this,&colorPicker, &Toolsettings);
case IntelliTool::Tooltype::PEN: return new IntelliToolPen(this,&colorPicker, &Toolsettings);
case IntelliTool::Tooltype::PLAIN: return new IntelliToolPlainTool(this,&colorPicker, &Toolsettings);
case IntelliTool::Tooltype::POLYGON: return new IntelliToolPolygon(this,&colorPicker, &Toolsettings);
case IntelliTool::Tooltype::RECTANGLE: return new IntelliToolRectangle(this,&colorPicker, &Toolsettings);
default: return nullptr;
case IntelliTool::Tooltype::NONE: return nullptr;
default: return nullptr;
}
}
@@ -526,7 +528,7 @@ void PaintingArea::historyGoBack(){
void PaintingArea::historyGoForward(){
historyPresent++;
if(historyPresent>=static_cast<int>(history.size())){
historyPresent=history.size()-1;
historyPresent=static_cast<int>(history.size()-1);
}
layerBundle = history[static_cast<size_t>(historyPresent)];
this->guiReference->UpdateGui();

View File

@@ -66,11 +66,11 @@ friend IntelliPhotoGui;
public:
/*!
* \brief PaintingArea is the constructor of the PaintingArea class, which initiates the working environment
* \param maxWidth - The maximum amount of pixles that are inside painting area from left to right (default=600px)
* \param maxHeight - The maximum amount of pixles that are inside painting area from top to bottom (default=600px)
* \param newMaxWidth - The maximum amount of pixles that are inside painting area from left to right (default=600px)
* \param newMaxHeight - The maximum amount of pixles that are inside painting area from top to bottom (default=600px)
* \param parent - The parent window of the main window (default=nullptr)
*/
PaintingArea(int maxWidth = 600, int maxHeight = 600, QWidget*parent = nullptr);
PaintingArea(int newMaxWidth = 600, int newMaxHeight = 600, QWidget*parent = nullptr);
/*!
* \brief This deconstructor is used to clear up the memory and remove the currently active window
@@ -85,7 +85,7 @@ void setRenderSettings(bool isFastRenderingOn);
/*!
* \brief getRenderSettings updates all Images to the new Rendersetting.
* \param isFastRenderingOn is the new given flag for the FastRenderer.
* \return Returns if the flag for the FastRendererin is enabled.
*/
bool getRenderSettings();
@@ -302,10 +302,10 @@ void historyGoForward();
/*!
* \brief setCanvasDimensions sets the dimension of the Canvas
* \param maxWidth - the width of the Canvas.
* \param maxHeight - the height of the Canvas.
* \param newMaxWidth - the width of the Canvas.
* \param newMaxHeight - the height of the Canvas.
*/
void setCanvasDimensions(int maxWidth, int maxHeight);
void setCanvasDimensions(int newMaxWidth, int newMaxHeight);
/*!
* \brief drawPixelOntoActive draws a pixel onto the image data of the active Layer.

View File

@@ -57,8 +57,8 @@ void IntelliTool::onWheelScrolled(int value){
bool IntelliTool::createToolLayer(){
if(Area->createTempTopLayer(Area->activeLayer)) {
this->activeLayer = &Area->layerBundle[static_cast<unsigned long long>(Area->activeLayer)];
this->Canvas = &Area->layerBundle[static_cast<unsigned long long>(Area->activeLayer + 1)];
this->activeLayer = &Area->layerBundle[static_cast<size_t>(Area->activeLayer)];
this->Canvas = &Area->layerBundle[static_cast<size_t>(Area->activeLayer + 1)];
return true;
}
return false;