mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-16 21:30:31 +02:00
Absturz behoben
Bei Mausraddrehen kam es zu Absturz, wenn Tool nullptr, weil Zugriff auf Tool
This commit is contained in:
@@ -277,11 +277,13 @@ void PaintingArea::mouseReleaseEvent(QMouseEvent*event){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PaintingArea::wheelEvent(QWheelEvent*event){
|
void PaintingArea::wheelEvent(QWheelEvent*event){
|
||||||
QPoint numDegrees = event->angleDelta() / 8;
|
if(this->Tool != nullptr){
|
||||||
if(!numDegrees.isNull()) {
|
QPoint numDegrees = event->angleDelta() / 8;
|
||||||
QPoint numSteps = numDegrees / 15;
|
if(!numDegrees.isNull()) {
|
||||||
Tool->onWheelScrolled(numSteps.y()* -1);
|
QPoint numSteps = numDegrees / 15;
|
||||||
}
|
Tool->onWheelScrolled(numSteps.y()* -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// QPainter provides functions to draw on the widget
|
// QPainter provides functions to draw on the widget
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
|
|
||||||
IntelliToolPolygon::IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* colorPicker)
|
IntelliToolPolygon::IntelliToolPolygon(PaintingArea* Area, IntelliColorPicker* colorPicker)
|
||||||
: IntelliTool(Area, colorPicker){
|
: IntelliTool(Area, colorPicker){
|
||||||
this->innerAlpha = QInputDialog::getInt(nullptr,"Inner Alpha Value", "Value:", 255,0,255,1);
|
this->innerAlpha = QInputDialog::getInt(nullptr,"Inner Alpha Value", "Value:", 255,0,255,1);
|
||||||
lineWidth = QInputDialog::getInt(nullptr,"Line Width Input", "Width",5,1,10,1);
|
lineWidth = QInputDialog::getInt(nullptr,"Line Width Input", "Width",5,1,10,1);
|
||||||
isPointNearStart = false;
|
isPointNearStart = false;
|
||||||
@@ -107,7 +107,7 @@ bool IntelliToolPolygon::isNearStart(int x, int y, QPoint Startpoint){
|
|||||||
bool isNear = false;
|
bool isNear = false;
|
||||||
int StartX = Startpoint.x();
|
int StartX = Startpoint.x();
|
||||||
int StartY = Startpoint.y();
|
int StartY = Startpoint.y();
|
||||||
int valueToNear = 10;
|
int valueToNear = 5;
|
||||||
|
|
||||||
for(int i = StartX - valueToNear; i < StartX + valueToNear; i++) {
|
for(int i = StartX - valueToNear; i < StartX + valueToNear; i++) {
|
||||||
for(int j = StartY - valueToNear; j < StartY + valueToNear; j++) {
|
for(int j = StartY - valueToNear; j < StartY + valueToNear; j++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user