mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-16 05:10:32 +02:00
warning fixen and better circle
This commit is contained in:
@@ -78,9 +78,8 @@ void IntelliPhotoGui::slotCreateNewLayer(){
|
|||||||
tr("Height:"),
|
tr("Height:"),
|
||||||
200,1, 500, 1, &ok2);
|
200,1, 500, 1, &ok2);
|
||||||
// Create New Layer
|
// Create New Layer
|
||||||
if (ok1&&ok2)
|
if (ok1&&ok2){
|
||||||
{
|
paintingArea->addLayer(width,height,0,0);
|
||||||
int layer = paintingArea->addLayer(width,height,0,0);
|
|
||||||
UpdateGui();
|
UpdateGui();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,8 +265,9 @@ std::vector<QPoint> PaintingArea::getPolygonDataOfRealLayer(){
|
|||||||
// left button and if so store the current position
|
// left button and if so store the current position
|
||||||
// Set that we are currently drawing
|
// Set that we are currently drawing
|
||||||
void PaintingArea::mousePressEvent(QMouseEvent*event){
|
void PaintingArea::mousePressEvent(QMouseEvent*event){
|
||||||
if(this->activeLayer < 0)
|
if(this->activeLayer < 0){
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if(Tool == nullptr)
|
if(Tool == nullptr)
|
||||||
return;
|
return;
|
||||||
int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
|
int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
|
||||||
@@ -283,8 +284,9 @@ void PaintingArea::mousePressEvent(QMouseEvent*event){
|
|||||||
// we call the drawline function which draws a line
|
// we call the drawline function which draws a line
|
||||||
// from the last position to the current
|
// from the last position to the current
|
||||||
void PaintingArea::mouseMoveEvent(QMouseEvent*event){
|
void PaintingArea::mouseMoveEvent(QMouseEvent*event){
|
||||||
if(this->activeLayer < 0)
|
if(this->activeLayer < 0){
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if(Tool == nullptr)
|
if(Tool == nullptr)
|
||||||
return;
|
return;
|
||||||
int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
|
int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ IntelliToolCircle::~IntelliToolCircle(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IntelliToolCircle::drawCircle(int radius){
|
void IntelliToolCircle::drawCircle(int radius){
|
||||||
int outer = radius+20;
|
|
||||||
QColor inner = this->colorPicker->getSecondColor();
|
QColor inner = this->colorPicker->getSecondColor();
|
||||||
inner.setAlpha(Toolsettings->getInnerAlpha());
|
inner.setAlpha(Toolsettings->getInnerAlpha());
|
||||||
int yMin, yMax, xMin, xMax;
|
int yMin, yMax, xMin, xMax;
|
||||||
@@ -27,7 +26,7 @@ void IntelliToolCircle::drawCircle(int radius){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO implement circle drawing algorithm bresenham
|
//TODO implement circle drawing algorithm bresenham
|
||||||
radius = static_cast<int>(radius +(Toolsettings->getLineWidth()/2.)-1.);
|
radius = static_cast<int>(radius +(Toolsettings->getLineWidth()/2.));
|
||||||
yMin = (centerPoint.y()-radius);
|
yMin = (centerPoint.y()-radius);
|
||||||
yMax = (centerPoint.y()+radius);
|
yMax = (centerPoint.y()+radius);
|
||||||
for(int i=yMin; i<=yMax; i++) {
|
for(int i=yMin; i<=yMax; i++) {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void IntelliToolLine::onMouseMoved(int x, int y){
|
|||||||
QPoint p2 =lineStartingPoint.x() < next.x() ? next : lineStartingPoint;
|
QPoint p2 =lineStartingPoint.x() < next.x() ? next : lineStartingPoint;
|
||||||
int m = static_cast<int>(static_cast<float>(p2.y()-p1.y())/static_cast<float>(p2.x()-p1.x())+0.5f);
|
int m = static_cast<int>(static_cast<float>(p2.y()-p1.y())/static_cast<float>(p2.x()-p1.x())+0.5f);
|
||||||
int c = lineStartingPoint.y()-lineStartingPoint.x()*m;
|
int c = lineStartingPoint.y()-lineStartingPoint.x()*m;
|
||||||
|
//TODO implement dotted algorithm
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user