Merge branch 'dev' into dev-warnings

This commit is contained in:
Jan Schuffenhauer
2020-01-16 12:18:33 +01:00
29 changed files with 2105 additions and 86 deletions

View File

@@ -82,7 +82,7 @@ void PaintingArea::deleteLayer(int idx, bool isTool){
if(!isTool) {
updateTools();
}
if(idx<static_cast<int>(layerBundle.size())) {
if(idx<static_cast<int>(layerBundle.size())&&idx>=0) {
this->layerBundle.erase(layerBundle.begin() + idx);
if(activeLayer>=idx) {
activeLayer--;
@@ -109,7 +109,9 @@ void PaintingArea::setLayerActive(int idx){
void PaintingArea::setLayerAlpha(int idx, int alpha){
if(idx>=0&&idx<static_cast<int>(layerBundle.size())) {
layerBundle[static_cast<size_t>(idx)].alpha = alpha;
if(alpha>=0 && alpha<=255) {
layerBundle[static_cast<size_t>(idx)].alpha = alpha;
}
}
}
void PaintingArea::setPolygon(int idx){

View File

@@ -14,6 +14,9 @@
#include "Tool/IntelliTool.h"
#include "IntelliHelper/IntelliColorPicker.h"
//for unit testing
class UnitTest;
/*!
* \brief The LayerObject struct holds all the information needed to construct a layer
*/
@@ -49,6 +52,10 @@ struct LayerObject {
*/
class PaintingArea : public QWidget
{
friend UnitTest;
// Declares our class as a QObject which is the base class
// for all Qt objects
// QObjects handle events
Q_OBJECT
friend IntelliTool;
friend IntelliPhotoGui;