]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsImage.C
The free_spacing patch and fix to the mess that Rob discovered.
[lyx.git] / src / graphics / GraphicsImage.C
index 96052c708ef91324cdb3a68673679fb76755195e..fd1ae1041ce2ee07c218257e6feccdb635f83469 100644 (file)
@@ -1,19 +1,17 @@
-/*
+/**
  * \file GraphicsImage.C
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Baruch Even <baruch.even@writeme.com>
- * \author Angus Leeming <leeming@lyx.org>
- * \author Herbert Voss <voss@lyx.org>
+ * \author Baruch Even
+ * \author Angus Leeming
+ * \author Herbert Voss
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "GraphicsImage.h"
 #include "GraphicsParams.h"
 #include "debug.h"
@@ -34,13 +32,15 @@ boost::function0<Image::FormatList> Image::loadableFormats;
 std::pair<unsigned int, unsigned int>
 Image::getScaledDimensions(Params const & params) const
 {
-       unsigned int width = getWidth();
-       unsigned int height = getHeight();
-
-       // scale only when value makes sense, i.e. not zero
+       // scale only when value > 0
+       unsigned int width;
+       unsigned int height;
        if (params.scale) {
-               width  = (width * params.scale) / 100;
-               height = (height * params.scale) / 100;
+               width  = (getWidth() * params.scale) / 100;
+               height = (getHeight() * params.scale) / 100;
+       } else {
+               width = getWidth();
+               height = getHeight();
        }
 
        lyxerr[Debug::GRAPHICS]
@@ -54,4 +54,3 @@ Image::getScaledDimensions(Params const & params) const
 }
 
 } // namespace grfx
-