mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-15 04:40:37 +02:00
updated functionality and set true to test.
Todo: Cleanub and make it activalable
This commit is contained in:
@@ -79,7 +79,10 @@ void IntelliTool::mergeToolLayer(){
|
|||||||
updatedImage.setPixelColor(x, y, clr_0);
|
updatedImage.setPixelColor(x, y, clr_0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
activeLayer->image->setImageData(updatedImage);
|
activeLayer->image->setImageData(updatedImage);
|
||||||
|
if(Canvas->image->getPolygonData().size() != 0){
|
||||||
|
activeLayer->image->setPolygon(Canvas->image->getPolygonData());
|
||||||
|
}
|
||||||
Area->DummyGui->UpdateGui();
|
Area->DummyGui->UpdateGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,24 +73,30 @@ void IntelliToolPolygon::onMouseLeftReleased(int x, int y){
|
|||||||
isInside = false;
|
isInside = false;
|
||||||
isPointNearStart = false;
|
isPointNearStart = false;
|
||||||
isDrawing = false;
|
isDrawing = false;
|
||||||
std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(QPointList);
|
if(false){
|
||||||
QPoint Point;
|
std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(QPointList);
|
||||||
QColor colorTwo(colorPicker->getSecondColor());
|
QPoint Point;
|
||||||
colorTwo.setAlpha(Toolsettings->getInnerAlpha());
|
QColor colorTwo(colorPicker->getSecondColor());
|
||||||
for(int i = 0; i < activeLayer->width; i++) {
|
colorTwo.setAlpha(Toolsettings->getInnerAlpha());
|
||||||
for(int j = 0; j < activeLayer->height; j++) {
|
for(int i = 0; i < activeLayer->width; i++) {
|
||||||
Point = QPoint(i,j);
|
for(int j = 0; j < activeLayer->height; j++) {
|
||||||
if(IntelliTriangulation::isInPolygon(Triangles,Point)) {
|
Point = QPoint(i,j);
|
||||||
this->Canvas->image->drawPixel(Point, colorTwo);
|
if(IntelliTriangulation::isInPolygon(Triangles,Point)) {
|
||||||
}
|
this->Canvas->image->drawPixel(Point, colorTwo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(int i=0; i<static_cast<int>(QPointList.size()); i++) {
|
}
|
||||||
int next = static_cast<int>((i+static_cast<int>(1))%static_cast<int>(QPointList.size()));
|
for(int i=0; i<static_cast<int>(QPointList.size()); i++) {
|
||||||
this->Canvas->image->drawLine(QPointList[static_cast<unsigned long long>(i)], QPointList[static_cast<unsigned long long>(next)], colorPicker->getFirstColor(), Toolsettings->getLineWidth());
|
int next = static_cast<int>((i+static_cast<int>(1))%static_cast<int>(QPointList.size()));
|
||||||
}
|
this->Canvas->image->drawLine(QPointList[static_cast<unsigned long long>(i)], QPointList[static_cast<unsigned long long>(next)], colorPicker->getFirstColor(), Toolsettings->getLineWidth());
|
||||||
QPointList.clear();
|
}
|
||||||
IntelliTool::onMouseLeftReleased(x,y);
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Canvas->image->setPolygon(QPointList);
|
||||||
|
}
|
||||||
|
IntelliTool::onMouseLeftReleased(x,y);
|
||||||
|
QPointList.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ virtual void onWheelScrolled(int value) override;
|
|||||||
*/
|
*/
|
||||||
virtual void onMouseMoved(int x, int y) override;
|
virtual void onMouseMoved(int x, int y) override;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INTELLITOOLPOLYGON_H
|
#endif // INTELLITOOLPOLYGON_H
|
||||||
|
|||||||
Reference in New Issue
Block a user