mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +02:00
warning fixen and better circle
This commit is contained in:
@@ -78,9 +78,8 @@ void IntelliPhotoGui::slotCreateNewLayer(){
|
||||
tr("Height:"),
|
||||
200,1, 500, 1, &ok2);
|
||||
// Create New Layer
|
||||
if (ok1&&ok2)
|
||||
{
|
||||
int layer = paintingArea->addLayer(width,height,0,0);
|
||||
if (ok1&&ok2){
|
||||
paintingArea->addLayer(width,height,0,0);
|
||||
UpdateGui();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,8 +265,9 @@ std::vector<QPoint> PaintingArea::getPolygonDataOfRealLayer(){
|
||||
// left button and if so store the current position
|
||||
// Set that we are currently drawing
|
||||
void PaintingArea::mousePressEvent(QMouseEvent*event){
|
||||
if(this->activeLayer < 0)
|
||||
if(this->activeLayer < 0){
|
||||
return;
|
||||
}
|
||||
if(Tool == nullptr)
|
||||
return;
|
||||
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
|
||||
// from the last position to the current
|
||||
void PaintingArea::mouseMoveEvent(QMouseEvent*event){
|
||||
if(this->activeLayer < 0)
|
||||
if(this->activeLayer < 0){
|
||||
return;
|
||||
}
|
||||
if(Tool == nullptr)
|
||||
return;
|
||||
int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
|
||||
|
||||
@@ -13,7 +13,6 @@ IntelliToolCircle::~IntelliToolCircle(){
|
||||
}
|
||||
|
||||
void IntelliToolCircle::drawCircle(int radius){
|
||||
int outer = radius+20;
|
||||
QColor inner = this->colorPicker->getSecondColor();
|
||||
inner.setAlpha(Toolsettings->getInnerAlpha());
|
||||
int yMin, yMax, xMin, xMax;
|
||||
@@ -27,7 +26,7 @@ void IntelliToolCircle::drawCircle(int radius){
|
||||
}
|
||||
|
||||
//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);
|
||||
yMax = (centerPoint.y()+radius);
|
||||
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;
|
||||
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;
|
||||
|
||||
//TODO implement dotted algorithm
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user