From 8c6b947eb5bffd9e1813a3f31101df9c48a8e049 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 30 Jul 2016 21:57:52 -0400 Subject: [PATCH] Use scaling factor in XHTML output. (cherry picked from commit 47c52db13e2f58224d31a2e26a69320f1f5b16cf) --- ANNOUNCE | 30 ++++++++++++++++-------------- src/insets/InsetGraphics.cpp | 18 ++++++++++++++---- status.22x | 6 ++++++ 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 1397ebb926..d3312067b5 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,27 +1,29 @@ -Public release of LyX version 2.2.1 +Public release of LyX version 2.2.2 =================================== -We are proud to announce the release of LyX 2.2.1. This is the first -maintenance release in the 2.2.x series. You can download LyX 2.2.1 from http://www.lyx.org/Download/. +We are proud to announce the release of LyX 2.2.2. This is the second +maintenance release in the 2.2.x series. + +You can download LyX 2.2.2 from http://www.lyx.org/Download/. LyX is a document processor that encourages an approach to writing based on the structure of your documents and not simply their appearance. It is released under a Free and Open Source Software license. -LyX 2.2.1 is the result of on-going efforts to make our stable version more +LyX 2.2.2 is the result of on-going efforts to make our stable version more reliable and more stable. We have fixed a number of bugs and made a number of improvements. Most of these are relatively minor, but we nonetheless -encourage all users of 2.2.0 to upgrade to this version. +encourage all users of 2.2.1 to upgrade to this version. -One important change is to the behavior of character styles. By default, -these now prohibit changes to the paragraph layout. Putting a description -inside a character style typically results in invalid LaTeX code, so this -makes certain mistakes harder to make. Power users who have taken advantage -of the previous behavior can restore it by adding "ForcePlain 0" to the -declaration of the character style, so long as this is done after "LyXType -charstyle" has been declared. -If you think you have found a bug in LyX 2.2.1, please open a bug report at + +One new feature is the use of the "scaling" option when exporting images +for XHTML. This does not work the same way as with LaTeX export. What it +does is add something like "width: 50%" to the style attribute. This will +ordinarily be interpreted by the browser as a percentage relative to the +current element. + +If you think you have found a bug in LyX 2.2.2, please open a bug report at http://www.lyx.org/trac/wiki/BugTrackerHome. If you're not sure whether it really is a bug, you can e-mail the LyX developers' mailing list (lyx-devel lists.lyx.org) and ask. @@ -31,7 +33,7 @@ documentation that comes with LyX and the LyX wiki, which lives at http://wiki.lyx.org/. If you can't find the answer there, e-mail the LyX users' list (lyx-users lists.lyx.org). -We hope you enjoy using LyX 2.2.1. +We hope you enjoy using LyX 2.2.2. The LyX team. http://www.lyx.org diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 04faae74a4..92203620b4 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -964,10 +964,20 @@ docstring InsetGraphics::xhtml(XHTMLStream & xs, OutputParams const & op) const // really be better to do width and height conversion, rather than to output // these parameters here. string imgstyle; - if (!params().width.zero()) - imgstyle += "width:" + params().width.asHTMLString() + ";"; - if (!params().height.zero()) - imgstyle += " height:" + params().height.asHTMLString() + ";"; + bool const havewidth = !params().width.zero(); + bool const haveheight = !params().height.zero(); + if (havewidth || haveheight) { + if (havewidth) + imgstyle += "width:" + params().width.asHTMLString() + ";"; + if (haveheight) + imgstyle += " height:" + params().height.asHTMLString() + ";"; + } else if (params().scale != "100") { + // Note that this will not have the same effect as in LaTeX export: + // There, the image will be scaled from its original size. Here, the + // percentage will be interpreted by the browser, and the image will + // be scaled to a percentage of the window size. + imgstyle = "width:" + params().scale + "%;"; + } if (!imgstyle.empty()) imgstyle = "style='" + imgstyle + "' "; diff --git a/status.22x b/status.22x index c8c7fa17c9..36b528c8d3 100644 --- a/status.22x +++ b/status.22x @@ -6,6 +6,7 @@ All comments are welcome. We try to group things by topic and in decreasing order of importance. Please feel free to re-arrange if that seems like a good idea. + What's new ========== @@ -37,6 +38,9 @@ What's new * DOCUMENT INPUT/OUTPUT +- We no longer attempt to convert images for which we cannot find an + input format. + * LYX2LYX @@ -79,6 +83,8 @@ What's new - Fix display of several math symbols (bug 8844). +- Use scaling factor for export of images (bug 8742). + * TEX2LYX