PolygonTool fertig

This commit is contained in:
AshBastian
2019-12-18 15:47:23 +01:00
parent 3525261e1e
commit 89b9e44677
10 changed files with 65 additions and 42 deletions

View File

@@ -24,7 +24,7 @@ PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget *parent)
this->setUp(maxWidth, maxHeight);
//tetsing
this->addLayer(200,200,0,0,ImageType::Shaped_Image);
layerBundle[0].image->drawPlain(QColor(255,0,0,255));
layerBundle[0].image->drawPlain(QColor(0,0,255,255));
std::vector<QPoint> polygon;
polygon.push_back(QPoint(100,000));
polygon.push_back(QPoint(200,100));
@@ -36,7 +36,7 @@ PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget *parent)
layerBundle[1].image->drawPlain(QColor(0,255,0,255));
layerBundle[1].alpha=200;
activeLayer=1;
activeLayer=0;
}
PaintingArea::~PaintingArea(){
@@ -193,6 +193,14 @@ void PaintingArea::createLineTool(){
Tool = new IntelliToolLine(this, &colorPicker);
}
int PaintingArea::getWidthActiveLayer(){
return layerBundle.operator[](activeLayer).width;
}
int PaintingArea::getHeightActiveLayer(){
return layerBundle.operator[](activeLayer).hight;
}
// If a mouse button is pressed check if it was the
// left button and if so store the current position
// Set that we are currently drawing

View File

@@ -59,6 +59,10 @@ public:
void createPlainTool();
void createLineTool();
//get Width and Height of active Layer
int getWidthActiveLayer();
int getHeightActiveLayer();
public slots:
// Events to handle