#include "support/translator.h"
#include "support/filetools.h"
+#include "support/lyxlib.h"
#include "support/LAssert.h"
{
subcaptionText = filename = string();
display = MONOCHROME;
- inlineFigure = false;
subcaption = false;
keepAspectRatio = true;
widthResize = DEFAULT_SIZE;
heightResize = DEFAULT_SIZE;
heightSize = 0.0;
rotateOrigin = DEFAULT;
- rotateAngle = 0;
+ rotateAngle = 0.0;
testInvariant();
}
{
filename = igp.filename;
display = igp.display;
- inlineFigure = igp.inlineFigure;
subcaption = igp.subcaption;
subcaptionText = igp.subcaptionText;
keepAspectRatio = igp.keepAspectRatio;
// The reason for this is that in latex there is a meaning for the
// different angles and they are not necessarliy interchangeable,
// it depends on the rotation origin.
- lyx::Assert(rotateAngle < 360);
- lyx::Assert(rotateAngle > -360);
+ lyx::Assert(rotateAngle < 360.0);
+ lyx::Assert(rotateAngle > -360.0);
}
{
if (left.filename == right.filename &&
left.display == right.display &&
- left.inlineFigure == right.inlineFigure &&
left.subcaption == right.subcaption &&
left.subcaptionText == right.subcaptionText &&
left.keepAspectRatio == right.keepAspectRatio &&
left.heightResize == right.heightResize &&
left.heightSize == right.heightSize &&
left.rotateOrigin == right.rotateOrigin &&
- left.rotateAngle == right.rotateAngle
+ lyx::float_equal(left.rotateAngle, right.rotateAngle, 0.001)
)
return true;
// Save the display type
os << " display " << displayTranslator.find(display) << '\n';
- // Save the inline status
- if (inlineFigure)
- os << " inline";
-
// Save the subcaption status
if (subcaption)
os << " subcaption";
writeResize(os, "height", heightResize, heightSize);
writeOrigin(os, rotateOrigin);
- if (rotateAngle != 0)
+ if (lyx::float_equal(rotateAngle, 0.0, 0.001))
os << " rotateAngle " << rotateAngle << '\n';
}
string const type = lex.GetString();
display = displayTranslator.find(type);
- } else if (token == "inline") {
- inlineFigure = true;
} else if (token == "subcaption") {
subcaption = true;
} else if (token == "subcaptionText") {
readOrigin(this, token);
} else if (token == "rotateAngle") {
lex.next();
- rotateAngle = lex.GetInteger();
+ rotateAngle = lex.GetFloat();
} else {
// If it's none of the above, its not ours.
return false;