This commit is contained in:
Hombre
2010-12-27 21:49:16 +01:00
parent 3a82636562
commit ed48eb4547
2 changed files with 11 additions and 6 deletions

View File

@@ -352,11 +352,6 @@ void Crop::trim (ProcParams* pp, int ow, int oh) {
int xmin = pp->crop.x;
int ymin = pp->crop.y;
if (pp->coarse.rotate == 90 || pp->coarse.rotate == 270) {
int tmp = oh;
oh = ow;
ow = tmp;
}
if (xmin > ow || ymin > oh) {
// the crop is completely out of the image, so we disable the crop
pp->crop.enabled = false;

View File

@@ -20,6 +20,7 @@
#include <toolpanelcoord.h>
#include <ilabel.h>
#include <options.h>
#include <imagesource.h>
using namespace rtengine::procparams;
@@ -217,12 +218,21 @@ void ToolPanelCoordinator::panelChanged (rtengine::ProcEvent event, const Glib::
void ToolPanelCoordinator::profileChange (const ProcParams *nparams, rtengine::ProcEvent event, const Glib::ustring& descr, const ParamsEdited* paramsEdited) {
int fw, fh, tr;
if (!ipc) return;
ProcParams *params = ipc->getParamsForUpdate (event);
*params = *nparams;
tr = TR_NONE;
if (params->coarse.rotate==90) tr |= TR_R90;
if (params->coarse.rotate==180) tr |= TR_R180;
if (params->coarse.rotate==270) tr |= TR_R270;
// trimming overflowing cropped area
crop->trim(params, ipc->getFullWidth(), ipc->getFullHeight());
rtengine::ImageSource *ii = (rtengine::ImageSource*)ipc->getInitialImage();
ii->getFullSize (fw, fh, tr);
crop->trim(params, fw, fh);
// updating the GUI with updated values
for (unsigned int i=0; i<toolPanels.size(); i++)