mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-14 12:20:32 +02:00
Merge branch 'dev' into dev-warnings
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user