This commit is contained in:
Mienek
2019-12-05 21:36:23 +01:00
parent fd1a6d2f9d
commit f2c56c27be
44 changed files with 5303 additions and 13 deletions

View File

@@ -27,6 +27,7 @@ PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget *parent)
this->addLayer(200,200,150,150);
layerStructure[1].image->floodFill(QColor(0,255,0,255));
layerStructure[1].alpha=200;
activeLayer=1;
}
@@ -50,7 +51,7 @@ void PaintingArea::setUp(int maxWidth, int maxHeight){
myPenColor = Qt::blue;
}
void PaintingArea::addLayer(int width, int height, int widthOffset, int heightOffset, ImageType type){
int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOffset, ImageType type){
LayerObject newLayer;
newLayer.width = width;
newLayer.height = height;
@@ -63,7 +64,7 @@ void PaintingArea::addLayer(int width, int height, int widthOffset, int heightOf
}
newLayer.alpha = 255;
this->layerStructure.push_back(newLayer);
return layerStructure.size()-1;
}
void PaintingArea::deleteLayer(int index){
@@ -180,7 +181,7 @@ void PaintingArea::getMoveLeft(int a){
}
void PaintingArea::getMoveLayerUp(){
if(activeLayer<layerStructure.size() && activeLayer>=0){
if(activeLayer<layerStructure.size()-1 && activeLayer>=0){
std::swap(layerStructure[activeLayer], layerStructure[activeLayer+1]);
activeLayer++;
}