mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-17 22:00:29 +02:00
fixed unit test
This commit is contained in:
@@ -23,7 +23,7 @@ IntelliToolPolygon::~IntelliToolPolygon(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
|
void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
|
||||||
if(!isDrawing && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
|
if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
|
||||||
if(Area->getPolygonDataOfRealLayer().size()>2) {
|
if(Area->getPolygonDataOfRealLayer().size()>2) {
|
||||||
std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(Area->getPolygonDataOfRealLayer());
|
std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(Area->getPolygonDataOfRealLayer());
|
||||||
QPoint Point(x,y);
|
QPoint Point(x,y);
|
||||||
@@ -80,6 +80,7 @@ void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IntelliToolPolygon::onMouseRightPressed(int x, int y){
|
void IntelliToolPolygon::onMouseRightPressed(int x, int y){
|
||||||
|
drawingOfPolygon = false;
|
||||||
isInside = false;
|
isInside = false;
|
||||||
isPointNearStart = false;
|
isPointNearStart = false;
|
||||||
QPointList.clear();
|
QPointList.clear();
|
||||||
@@ -90,6 +91,7 @@ void IntelliToolPolygon::onMouseLeftReleased(int x, int y){
|
|||||||
if(isPointNearStart) {
|
if(isPointNearStart) {
|
||||||
isInside = false;
|
isInside = false;
|
||||||
isPointNearStart = false;
|
isPointNearStart = false;
|
||||||
|
drawingOfPolygon = false;
|
||||||
if(!isSettingPolygon) {
|
if(!isSettingPolygon) {
|
||||||
std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(QPointList);
|
std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(QPointList);
|
||||||
QPoint Point;
|
QPoint Point;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ void cleanupTestCase();
|
|||||||
|
|
||||||
///Test here
|
///Test here
|
||||||
|
|
||||||
|
|
||||||
//test painting area
|
//test painting area
|
||||||
void test_addLayer();
|
void test_addLayer();
|
||||||
void test_deleteLayer();
|
void test_deleteLayer();
|
||||||
@@ -171,7 +172,7 @@ void UnitTest::initTestCase()
|
|||||||
|
|
||||||
void UnitTest::cleanupTestCase()
|
void UnitTest::cleanupTestCase()
|
||||||
{
|
{
|
||||||
delete gui;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//test painting area
|
//test painting area
|
||||||
|
|||||||
Reference in New Issue
Block a user