added comments but gui

This commit is contained in:
Sonaion
2020-01-28 10:41:54 +01:00
parent 797355b4f3
commit 3a13904eea
14 changed files with 935 additions and 39 deletions

View File

@@ -40,7 +40,7 @@ LayerObject::LayerObject(const LayerObject& layer){
PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget*parent)
: QLabel(parent){
this->Tool = nullptr;
this->setLayerDimensions(maxWidth, maxHeight);
this->setCanvasDimensions(maxWidth, maxHeight);
activeLayer = -1;
}
@@ -69,7 +69,7 @@ bool PaintingArea::getRenderSettings(){
return this->renderSettings.isFastRenderering();
}
void PaintingArea::setLayerDimensions(int maxWidth, int maxHeight){
void PaintingArea::setCanvasDimensions(int maxWidth, int maxHeight){
//set standart parameter
this->maxWidth = maxWidth;
this->maxHeight = maxHeight;
@@ -83,7 +83,7 @@ void PaintingArea::setLayerDimensions(int maxWidth, int maxHeight){
}
void PaintingArea::setPixelToActive(QColor color, QPoint point){
void PaintingArea::drawPixelOntoActive(QColor color, QPoint point){
layerBundle[static_cast<size_t>(activeLayer)].image->drawPixel(point, color);
}
@@ -296,11 +296,11 @@ int PaintingArea::getMaxHeight(){
return this->maxHeight;
}
ImageType PaintingArea::getTypeOfImageRealLayer(){
ImageType PaintingArea::getTypeOfImageActiveLayer(){
return this->layerBundle[static_cast<size_t>(activeLayer)].image->getTypeOfImage();
}
std::vector<QPoint> PaintingArea::getPolygonDataOfRealLayer(){
std::vector<QPoint> PaintingArea::getPolygonDataOfActiveLayer(){
return this->layerBundle[static_cast<size_t>(activeLayer)].image->getPolygonData();
}
@@ -463,7 +463,7 @@ IntelliTool* PaintingArea::copyActiveTool(){
}
}
int PaintingArea::getNumberOfActiveLayer(){
int PaintingArea::getIndexOfActiveLayer(){
return activeLayer;
}
@@ -510,14 +510,18 @@ void PaintingArea::updateTools(){
void PaintingArea::historyadd(){
if (++historyPresent == 100) {
historyPresent++;
if (historyPresent == 100) {
historyPresent = 0;
}
historyMaxFuture = historyPresent;
if (historyPresent == historyMaxPast)
if (++historyMaxPast == 100)
if (historyPresent == historyMaxPast){
historyMaxPast++;
if (historyMaxPast == 100){
historyMaxPast = 0;
history[static_cast<size_t>(historyPresent)] = layerBundle;
}
}
history[static_cast<size_t>(historyPresent)] = layerBundle;
}
void PaintingArea::historyGoBack(){