diff Applications/Samples/SingleFrameEditorApplication.h @ 353:92a159481900 am-2

removed useless variable
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 29 Oct 2018 11:53:34 +0100
parents d95e65ebe0b9
children f806779bd40f
line wrap: on
line diff
--- a/Applications/Samples/SingleFrameEditorApplication.h	Mon Oct 29 11:51:35 2018 +0100
+++ b/Applications/Samples/SingleFrameEditorApplication.h	Mon Oct 29 11:53:34 2018 +0100
@@ -1516,8 +1516,6 @@
       bool                         roundScaling_;
       double                       originalSpacingX_;
       double                       originalSpacingY_;
-      double                       originalPanX_;
-      double                       originalPanY_;
       BitmapStack::Corner          oppositeCorner_;
       double                       oppositeX_;
       double                       oppositeY_;
@@ -1548,8 +1546,6 @@
         {
           originalSpacingX_ = accessor_.GetBitmap().GetPixelSpacingX();
           originalSpacingY_ = accessor_.GetBitmap().GetPixelSpacingY();
-          originalPanX_ = accessor_.GetBitmap().GetPanX();
-          originalPanY_ = accessor_.GetBitmap().GetPanY();
 
           switch (corner)
           {
@@ -1621,13 +1617,14 @@
           }
           
           BitmapStack::Bitmap& bitmap = accessor_.GetBitmap();
-          bitmap.SetPixelSpacing(scaling * originalSpacingX_, scaling * originalSpacingY_);
+          bitmap.SetPixelSpacing(scaling * originalSpacingX_,
+                                 scaling * originalSpacingY_);
 
           // Keep the opposite corner at a fixed location
           double ox, oy;
           bitmap.GetCorner(ox, oy, oppositeCorner_);
-          bitmap.SetPan((-ox + oppositeX_) + bitmap.GetPanX(),
-                        (-oy + oppositeY_) + bitmap.GetPanY());
+          bitmap.SetPan(bitmap.GetPanX() + oppositeX_ - ox,
+                        bitmap.GetPanY() + oppositeY_ - oy);
         }
       }
     };