mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Ensure that graphics BoundingBox member variables are initialised.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3899 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
12f082c3ba
commit
4a964acbe7
@ -1,3 +1,8 @@
|
||||
2002-04-04 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* GraphicsParams.C (c-tor): ensure that the member variables are
|
||||
initialised.
|
||||
|
||||
2002-03-26 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* GraphicsCacheItem.C (convertToDisplayFormat): don't launch that Alert
|
||||
|
@ -109,6 +109,7 @@ BoundingBox::BoundingBox()
|
||||
|
||||
|
||||
BoundingBox::BoundingBox(string const & bb)
|
||||
: xl(0), yb(0), xr(0), yt(0)
|
||||
{
|
||||
if (bb.empty())
|
||||
return;
|
||||
@ -139,18 +140,22 @@ BoundingBox::BoundingBox(string const & bb)
|
||||
// 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 = 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));
|
||||
unsigned int const xl_tmp =
|
||||
uint(scaling_factor * length_xl.inPixels(1, 1));
|
||||
unsigned int const yb_tmp =
|
||||
uint(scaling_factor * length_yb.inPixels(1, 1));
|
||||
unsigned int const xr_tmp =
|
||||
uint(scaling_factor * length_xr.inPixels(1, 1));
|
||||
unsigned int const yt_tmp =
|
||||
uint(scaling_factor * length_yt.inPixels(1, 1));
|
||||
|
||||
if (xr <= xl || yt <= yb) {
|
||||
xl = 0;
|
||||
yb = 0;
|
||||
xr = 0;
|
||||
yt = 0;
|
||||
if (xr <= xl || yt <= yb)
|
||||
return;
|
||||
}
|
||||
|
||||
xl = xl_tmp;
|
||||
yb = yb_tmp;
|
||||
xr = xr_tmp;
|
||||
yt = yt_tmp;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user