mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Fix PDF output of clipped graphics with recent graphics package
The previous redirection of the senseless option "bb" to "viewport" in PDFLaTeX output has been removed in a recent graphics package update. This breaks documents, since clipped graphics silently stop displaying. This change restores the previous output by using "viewport" instaed of "bb" for non-PS/DVI output, while leaving PS/DVI untouched (where "bb" and "viewport" behave differently. Fixes: #7910
This commit is contained in:
parent
e7122d7926
commit
aaf17b08a8
@ -304,17 +304,19 @@ void InsetGraphics::read(Lexer & lex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string InsetGraphics::createLatexOptions() const
|
string InsetGraphics::createLatexOptions(bool const ps) const
|
||||||
{
|
{
|
||||||
// Calculate the options part of the command, we must do it to a string
|
// Calculate the options part of the command, we must do it to a string
|
||||||
// stream since we might have a trailing comma that we would like to remove
|
// stream since we might have a trailing comma that we would like to remove
|
||||||
// before writing it to the output stream.
|
// before writing it to the output stream.
|
||||||
ostringstream options;
|
ostringstream options;
|
||||||
if (!params().bbox.empty())
|
if (!params().bbox.empty()) {
|
||||||
options << "bb=" << params().bbox.xl.asLatexString() << ' '
|
string const key = ps ? "bb=" : "viewport=";
|
||||||
|
options << key << params().bbox.xl.asLatexString() << ' '
|
||||||
<< params().bbox.yb.asLatexString() << ' '
|
<< params().bbox.yb.asLatexString() << ' '
|
||||||
<< params().bbox.xr.asLatexString() << ' '
|
<< params().bbox.xr.asLatexString() << ' '
|
||||||
<< params().bbox.yt.asLatexString() << ',';
|
<< params().bbox.yt.asLatexString() << ',';
|
||||||
|
}
|
||||||
if (params().draft)
|
if (params().draft)
|
||||||
options << "draft,";
|
options << "draft,";
|
||||||
if (params().clip)
|
if (params().clip)
|
||||||
@ -765,7 +767,9 @@ void InsetGraphics::latex(otexstream & os,
|
|||||||
before += "\\includegraphics";
|
before += "\\includegraphics";
|
||||||
|
|
||||||
// Write the options if there are any.
|
// Write the options if there are any.
|
||||||
string const opts = createLatexOptions();
|
bool const ps = runparams.flavor == OutputParams::LATEX
|
||||||
|
|| runparams.flavor == OutputParams::DVILUATEX;
|
||||||
|
string const opts = createLatexOptions(ps);
|
||||||
LYXERR(Debug::GRAPHICS, "\tOpts = " << opts);
|
LYXERR(Debug::GRAPHICS, "\tOpts = " << opts);
|
||||||
|
|
||||||
if (!opts.empty() && !message.empty())
|
if (!opts.empty() && !message.empty())
|
||||||
|
@ -114,7 +114,7 @@ private:
|
|||||||
/// Get the status message, depends on the image loading status.
|
/// Get the status message, depends on the image loading status.
|
||||||
std::string statusMessage() const;
|
std::string statusMessage() const;
|
||||||
/// Create the options for the latex command.
|
/// Create the options for the latex command.
|
||||||
std::string createLatexOptions() const;
|
std::string createLatexOptions(bool const ps) const;
|
||||||
/// Create length values for docbook export.
|
/// Create length values for docbook export.
|
||||||
docstring toDocbookLength(Length const & len) const;
|
docstring toDocbookLength(Length const & len) const;
|
||||||
/// Create the atributes for docbook export.
|
/// Create the atributes for docbook export.
|
||||||
|
Loading…
Reference in New Issue
Block a user