some tweaks to the cropping GUI, inspired by recent comments on pixls.us
This commit is contained in:
@@ -313,7 +313,7 @@ void CropWindow::buttonPress (int button, int type, int bstate, int x, int y)
|
|||||||
changeZoom (zoom11index, true, action_x, action_y);
|
changeZoom (zoom11index, true, action_x, action_y);
|
||||||
fitZoom = false;
|
fitZoom = false;
|
||||||
} else {
|
} else {
|
||||||
zoomFit ();
|
zoomFitCrop ();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
zoom11 ();
|
zoom11 ();
|
||||||
@@ -612,6 +612,10 @@ void CropWindow::buttonRelease (int button, int num, int bstate, int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
needRedraw = true;
|
needRedraw = true;
|
||||||
|
|
||||||
|
if (fitZoom) {
|
||||||
|
zoomFitCrop();
|
||||||
|
}
|
||||||
} else if (state == SCropWinMove) {
|
} else if (state == SCropWinMove) {
|
||||||
if (iarea->showColorPickers () && !colorPickers.empty()) {
|
if (iarea->showColorPickers () && !colorPickers.empty()) {
|
||||||
needRedraw = true;
|
needRedraw = true;
|
||||||
@@ -722,6 +726,10 @@ void CropWindow::buttonRelease (int button, int num, int bstate, int x, int y)
|
|||||||
cropgl->cropManipReady ();
|
cropgl->cropManipReady ();
|
||||||
iarea->setToolHand ();
|
iarea->setToolHand ();
|
||||||
needRedraw = true;
|
needRedraw = true;
|
||||||
|
|
||||||
|
if (fitZoom) {
|
||||||
|
zoomFitCrop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decorated) {
|
if (decorated) {
|
||||||
@@ -1356,6 +1364,12 @@ void CropWindow::expose (Cairo::RefPtr<Cairo::Context> cr)
|
|||||||
drawObservedFrame (cr);
|
drawObservedFrame (cr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
CropParams cropParams = cropHandler.cropParams;
|
||||||
|
if (state == SNormal && cropParams.guide != "None") {
|
||||||
|
cropParams.guide = "Frame";
|
||||||
|
}
|
||||||
|
bool useBgColor = (state == SNormal);
|
||||||
|
|
||||||
if (cropHandler.cropPixbuf) {
|
if (cropHandler.cropPixbuf) {
|
||||||
imgW = cropHandler.cropPixbuf->get_width ();
|
imgW = cropHandler.cropPixbuf->get_width ();
|
||||||
imgH = cropHandler.cropPixbuf->get_height ();
|
imgH = cropHandler.cropPixbuf->get_height ();
|
||||||
@@ -1772,7 +1786,7 @@ void CropWindow::expose (Cairo::RefPtr<Cairo::Context> cr)
|
|||||||
if (cropHandler.cropParams.enabled) {
|
if (cropHandler.cropParams.enabled) {
|
||||||
int cropX, cropY;
|
int cropX, cropY;
|
||||||
cropHandler.getPosition (cropX, cropY);
|
cropHandler.getPosition (cropX, cropY);
|
||||||
drawCrop (cr, x + imgAreaX + imgX, y + imgAreaY + imgY, imgW, imgH, cropX, cropY, zoomSteps[cropZoom].zoom, cropHandler.cropParams, (this == iarea->mainCropWindow), true, cropHandler.isFullDisplay ());
|
drawCrop (cr, x + imgAreaX + imgX, y + imgAreaY + imgY, imgW, imgH, cropX, cropY, zoomSteps[cropZoom].zoom, cropParams, (this == iarea->mainCropWindow), useBgColor, cropHandler.isFullDisplay ());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (observedCropWin) {
|
if (observedCropWin) {
|
||||||
@@ -1853,7 +1867,7 @@ void CropWindow::expose (Cairo::RefPtr<Cairo::Context> cr)
|
|||||||
cr->fill();
|
cr->fill();
|
||||||
|
|
||||||
if (cropHandler.cropParams.enabled) {
|
if (cropHandler.cropParams.enabled) {
|
||||||
drawCrop (cr, x + imgAreaX + imgX, y + imgAreaY + imgY, rough->get_width(), rough->get_height(), cropX, cropY, zoomSteps[cropZoom].zoom, cropHandler.cropParams, (this == iarea->mainCropWindow), true, cropHandler.isFullDisplay ());
|
drawCrop (cr, x + imgAreaX + imgX, y + imgAreaY + imgY, rough->get_width(), rough->get_height(), cropX, cropY, zoomSteps[cropZoom].zoom, cropParams, (this == iarea->mainCropWindow), useBgColor, cropHandler.isFullDisplay ());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (observedCropWin) {
|
if (observedCropWin) {
|
||||||
@@ -2097,7 +2111,7 @@ void CropWindow::zoomFitCrop ()
|
|||||||
centerY = cropHandler.cropParams.y + cropHandler.cropParams.h / 2;
|
centerY = cropHandler.cropParams.y + cropHandler.cropParams.h / 2;
|
||||||
setCropAnchorPosition(centerX, centerY);
|
setCropAnchorPosition(centerX, centerY);
|
||||||
changeZoom (cz, true, centerX, centerY);
|
changeZoom (cz, true, centerX, centerY);
|
||||||
fitZoom = false;
|
fitZoom = true; //false;
|
||||||
} else {
|
} else {
|
||||||
zoomFit();
|
zoomFit();
|
||||||
}
|
}
|
||||||
|
@@ -638,7 +638,7 @@ void ImageArea::initialImageArrived (CropWindow* cw)
|
|||||||
|
|
||||||
if (mainCropWindow) {
|
if (mainCropWindow) {
|
||||||
if(firstOpen || options.prevdemo != PD_Sidecar || (!options.rememberZoomAndPan) ) {
|
if(firstOpen || options.prevdemo != PD_Sidecar || (!options.rememberZoomAndPan) ) {
|
||||||
mainCropWindow->zoomFit ();
|
mainCropWindow->zoomFitCrop ();
|
||||||
firstOpen = false;
|
firstOpen = false;
|
||||||
mainCropWindow->cropHandler.getFullImageSize(fullImageWidth, fullImageHeight);
|
mainCropWindow->cropHandler.getFullImageSize(fullImageWidth, fullImageHeight);
|
||||||
} else {
|
} else {
|
||||||
@@ -646,7 +646,7 @@ void ImageArea::initialImageArrived (CropWindow* cw)
|
|||||||
mainCropWindow->cropHandler.getFullImageSize(w, h);
|
mainCropWindow->cropHandler.getFullImageSize(w, h);
|
||||||
|
|
||||||
if(w != fullImageWidth || h != fullImageHeight) {
|
if(w != fullImageWidth || h != fullImageHeight) {
|
||||||
mainCropWindow->zoomFit ();
|
mainCropWindow->zoomFitCrop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
fullImageWidth = w;
|
fullImageWidth = w;
|
||||||
|
Reference in New Issue
Block a user