From ed48eb4547291dc31d20433429b404b4bfcfcff2 Mon Sep 17 00:00:00 2001 From: Hombre Date: Mon, 27 Dec 2010 21:49:16 +0100 Subject: [PATCH] Fix issue #407 --- rtgui/crop.cc | 5 ----- rtgui/toolpanelcoord.cc | 12 +++++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/rtgui/crop.cc b/rtgui/crop.cc index 4005b73e0..3dc34a807 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -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; diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index a8b88531a..e53a60ad2 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -20,6 +20,7 @@ #include #include #include +#include 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