Wolfgang Goetz wrote:

> Hello,
> 
> just a little flaw with crop and rotate:
> 
> working on a picture with crop and rotate:
> 
> immediately changeing to lighttable doesn't honor the settled values.

...because the result of changeing the crop area is not memorized
instantly. 

please have a look at attached patch!

commit is done when mouse 1 changes from 1 to 0. 
(aka button1released)




Flaw with history: (the other half of the Problem)

1) edit pic, enable crop and rotate, change crop area. 
2) change to lighttable directly (picture is ok with new crop) 
3) change back ... *full* piucture shown, 
        but crop and rotate module is unfolded and active.

workaround: 
1)fold/unfold crop and rotate
2)select history item below crop and rotate, 
        then select crop and rotate



any ideas?
kind regards
Wolfgang











> 
> 
> state is stored as expected when:
> 1) doubleclick in picture
> 2) closing crop and rotate by triangle button or 
>    selection of another module.
> 
> 
> Fix?:
> would be nice if changeing another mode (here:lighttable) would
> trigger saving crop and rotate's work. 
> 
> 
> 
> kind regards!
> Wolfgang
> (working on git-version)


diff --git a/src/iop/clipping.c b/src/iop/clipping.c
index 811896c..1761c77 100644
--- a/src/iop/clipping.c
+++ b/src/iop/clipping.c
@@ -2307,6 +2307,15 @@ void gui_post_expose(struct dt_iop_module_t *self, cairo_t *cr, int32_t width, i
       }
     }
   }
+
+  static int mouse=0;
+  if(darktable.control->button_down_which==1){
+    mouse = 1;
+  }
+  else if(mouse==1){ //mouse 1 released
+    mouse=0;
+    commit_box (self, g, p);
+  }
 }
 
 //determine the distance between the segment [(xa,ya)(xb,yb)] and the point (xc,yc)

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
darktable-devel mailing list
darktable-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/darktable-devel

Reply via email to