--- gimp-2.2.0/app/core/gimp.c.old	2005-01-02 18:07:52.933501840 +0100
+++ gimp-2.2.0/app/core/gimp.c	2005-01-02 18:07:52.933501840 +0100
***************
*** 111,116 ****
--- 111,117 ----
  
  static guint gimp_signals[LAST_SIGNAL] = { 0, };
  
+ gdouble gimp_last_angle=0;
  
  GType
  gimp_get_type (void)
--- gimp-2.2.0/app/tools/gimpmeasuretool.c.old	2005-01-02 18:07:24.789780336 +0100
+++ gimp-2.2.0/app/tools/gimpmeasuretool.c	2005-01-02 18:07:24.789780336 +0100
***************
*** 105,110 ****
--- 105,111 ----

  static GimpDrawToolClass *parent_class = NULL;

+ extern gdouble gimp_last_angle;

  void
  gimp_measure_tool_register (GimpToolRegisterCallback  callback,
***************
*** 765,770 ****
--- 766,773 ----
    theta1 = gimp_measure_tool_get_angle (ax, ay, 1.0, 1.0);
    theta2 = gimp_measure_tool_get_angle (bx, by, 1.0, 1.0);

+   gimp_last_angle=theta1;
+
    pixel_angle = fabs (theta1 - theta2);
    if (pixel_angle > 180.0)
      pixel_angle = fabs (360.0 - pixel_angle);
--- gimp-2.2.0/app/tools/gimprotatetool.c.old	2005-01-02 18:07:07.360430000 +0100
+++ gimp-2.2.0/app/tools/gimprotatetool.c	2005-01-02 18:07:07.360430000 +0100
***************
*** 19,24 ****
--- 19,25 ----
  #include "config.h"

  #include <gtk/gtk.h>
+ #include <math.h>

  #include "libgimpmath/gimpmath.h"
  #include "libgimpwidgets/gimpwidgets.h"
***************
*** 57,62 ****
--- 58,65 ----
  #define EPSILON      0.018  /*  ~ 1 degree  */
  #define FIFTEEN_DEG  (G_PI / 12.0)

+ extern gdouble gimp_last_angle;
+

  /*  local function prototypes  */

***************
*** 223,229 ****
  {
    GimpRotateTool *rotate = GIMP_ROTATE_TOOL (tr_tool);

!   rotate->angle_val      = 0.0;
    rotate->center_vals[0] = tr_tool->cx;
    rotate->center_vals[1] = tr_tool->cy;

--- 226,239 ----
  {
    GimpRotateTool *rotate = GIMP_ROTATE_TOOL (tr_tool);

!   gdouble tmp_angle=gimp_last_angle;
!   tmp_angle=fmod(tmp_angle,90);
!   tmp_angle=fmod((tmp_angle+45),90)-45;
!   tmp_angle=gimp_deg_to_rad (tmp_angle);
!   if (tr_tool->direction == GIMP_TRANSFORM_BACKWARD)
!       tmp_angle*=-1;
!
!   rotate->angle_val      = tmp_angle;
    rotate->center_vals[0] = tr_tool->cx;
    rotate->center_vals[1] = tr_tool->cy;

  
