]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsImage.cpp
de.po: fix doubled accelerator keys
[lyx.git] / src / graphics / GraphicsImage.cpp
1 /**
2  * \file GraphicsImage.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Baruch Even
7  * \author Angus Leeming
8  * \author Herbert Voß
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #include <config.h>
14
15 #include "GraphicsImage.h"
16 #include "GraphicsParams.h"
17
18 #include "support/debug.h"
19
20
21 namespace lyx {
22 namespace graphics {
23
24 // This is to be connected to a function that will return a new
25 // instance of a viable derived class.
26 boost::function<Image *()> Image::newImage;
27
28 Dimension Image::scaledDimension(Params const & params) const
29 {
30         // scale only when value > 0
31         unsigned int w = width();
32         unsigned int h = height();
33         if (params.scale) {
34                 w = (w * params.scale) / 100;
35                 h = (h * params.scale) / 100;
36         }
37
38         LYXERR(Debug::GRAPHICS, "graphics::Image::getScaledDimensions()"
39                 << "\n\tparams.scale       : " << params.scale
40                 << "\n\twidth              : " << w
41                 << "\n\theight             : " << h);
42
43         return Dimension(w, h, 0);
44 }
45
46 } // namespace graphics
47 } // namespace lyx