// No scaling
return std::make_pair(getWidth(), getHeight());
- unsigned int width = 0;
- unsigned int height = 0;
+ typedef unsigned int dimension;
+ dimension width = 0;
+ dimension height = 0;
if (params.scale != 0) {
- width = getWidth() * params.scale / 100.0;
- height = getHeight() * params.scale / 100.0;
+ width = dimension(getWidth() * params.scale / 100.0);
+ height = dimension(getHeight() * params.scale / 100.0);
} else {
width = params.width;
height = params.height;
// inPixels returns a value scaled by lyxrc.zoom.
// We want, therefore, to undo this.
double const scaling_factor = 100.0 / double(lyxrc.zoom);
- width = int(scaling_factor * width);
- height = int(scaling_factor * height);
+ width = uint(scaling_factor * width);
+ height = uint(scaling_factor * height);
}
}
// want the bounding box in Postscript pixels.
// Note further that there are 72 Postscript pixels per inch.
double const scaling_factor = 7200.0 / (lyxrc.dpi * lyxrc.zoom);
- xl = int(scaling_factor * length_xl.inPixels(1, 1));
- yb = int(scaling_factor * length_yb.inPixels(1, 1));
- xr = int(scaling_factor * length_xr.inPixels(1, 1));
- yt = int(scaling_factor * length_yt.inPixels(1, 1));
+ xl = uint(scaling_factor * length_xl.inPixels(1, 1));
+ yb = uint(scaling_factor * length_yb.inPixels(1, 1));
+ xr = uint(scaling_factor * length_xr.inPixels(1, 1));
+ yt = uint(scaling_factor * length_yt.inPixels(1, 1));
if (xr <= xl || yt <= yb) {
xl = 0;
/// 0 0 0 0 is empty!
bool empty() const;
- ///
- int xl;
- int yb;
- int xr;
- int yt;
+
+ unsigned int xl;
+ unsigned int yb;
+ unsigned int xr;
+ unsigned int yt;
};
-///
bool operator==(BoundingBox const &, BoundingBox const &);
-///
bool operator!=(BoundingBox const &, BoundingBox const &);
struct GParams
{
- ///
GParams(InsetGraphicsParams const &);
/// How is the image to be displayed on the LyX screen?
enum DisplayType {
- ///
COLOR,
- ///
GRAYSCALE,
- ///
MONOCHROME,
/// We aren't going to display it at all!
NONE
};
- ///
DisplayType display;
/// The image filename.
string filename;
- ///
BoundingBox bb;
/** The size of the view inside lyx in pixels or the scaling of the
* image.
*/
unsigned int width;
- ///
unsigned int height;
- ///
unsigned int scale;
/// Rotation angle.
int angle;
};
-///
bool operator==(GParams const &, GParams const &);
-///
bool operator!=(GParams const &, GParams const &);
} // namespace grfx