Spot removal : differentiating source/dest, betted cursor handling

+ some code cleanup from floessie (see issue #2239)
This commit is contained in:
Hombre
2019-09-01 02:08:48 +02:00
parent 4b7e8b7705
commit 82e7caa635
14 changed files with 222 additions and 132 deletions

View File

@@ -497,7 +497,7 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y)
cropgl->cropInit (cropHandler.cropParams->x, cropHandler.cropParams->y, cropHandler.cropParams->w, cropHandler.cropParams->h);
} else if (iarea->getToolMode () == TMHand) {
if (editSubscriber) {
if ((cropgl && cropgl->inImageArea(iarea->posImage.x, iarea->posImage.y) && editSubscriber->getEditingType() == ET_PIPETTE && (bstate & GDK_CONTROL_MASK))) {
if ((cropgl && cropgl->inImageArea(iarea->posImage.x, iarea->posImage.y) && (editSubscriber->getEditingType() == ET_PIPETTE && (bstate & GDK_CONTROL_MASK))) || editSubscriber->getEditingType() == ET_OBJECTS) {
needRedraw = editSubscriber->button1Pressed(bstate);
if (editSubscriber->isDragging()) {
state = SEditDrag1;
@@ -1277,7 +1277,10 @@ void CropWindow::updateCursor (int x, int y)
} else if (onArea (CropToolBar, x, y)) {
newType = CSMove;
} else if (iarea->getObject() > -1 && editSubscriber && editSubscriber->getEditingType() == ET_OBJECTS) {
newType = editSubscriber->getCursor(iarea->getObject());
int cursorX;
int cursorY;
screenCoordToImage (x, y, cursorX, cursorY);
newType = editSubscriber->getCursor(iarea->getObject(), cursorX, cursorY);
} else if (onArea (CropResize, x, y)) {
newType = CSResizeDiagonal;
} else if (tm == TMColorPicker && hoveredPicker) {
@@ -1304,7 +1307,10 @@ void CropWindow::updateCursor (int x, int y)
}
if (objectID > -1) {
newType = editSubscriber->getCursor(objectID);
int cursorX;
int cursorY;
screenCoordToImage (x, y, cursorX, cursorY);
newType = editSubscriber->getCursor(objectID, cursorX, cursorY);
} else if (tm == TMHand) {
if (onArea (CropObserved, x, y)) {
newType = CSMove;
@@ -1330,7 +1336,10 @@ void CropWindow::updateCursor (int x, int y)
}
if (objectID > -1) {
newType = editSubscriber->getCursor(objectID);
int cursorX;
int cursorY;
screenCoordToImage (x, y, cursorX, cursorY);
newType = editSubscriber->getCursor(objectID, cursorX, cursorY);
} else {
newType = CSArrow;
}
@@ -1359,6 +1368,16 @@ void CropWindow::updateCursor (int x, int y)
newType = CSResizeDiagonal;
} else if (state == SDragPicker) {
newType = CSMove2D;
} else if (editSubscriber && editSubscriber->getEditingType() == ET_OBJECTS) {
int objectID = iarea->getObject();
if (objectID > -1) {
int cursorX;
int cursorY;
screenCoordToImage (x, y, cursorX, cursorY);
newType = editSubscriber->getCursor(objectID, cursorX, cursorY);
} else {
newType = CSArrow;
}
}
if (newType != cursor_type) {