Le 21/07/2016 à 19:10, Scott Kostyshak a écrit :
On Thu, Jul 21, 2016 at 04:32:09PM +0200, Jean-Marc Lasgouttes wrote:

I'd be interested to have input at this point.

No input but I'll be happy to test when you have a patch. It seems like
one of those things that we'll just have to test to see if there are
issues.

I wanted to put this on trac, but the web site seems to be under heavy load. Restarting httpd did not help.

JMarc



>From 467099841cda86ab942e4400d348b3637f854063 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Thu, 21 Jul 2016 20:16:27 +0200
Subject: [PATCH] Remove horizontal spacing around previews

This concerns the preview version of InsetPreview and InsetIPA.

Fixes bug #10304.
---
 src/insets/InsetIPA.cpp     | 9 +++------
 src/insets/InsetPreview.cpp | 5 +----
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/insets/InsetIPA.cpp b/src/insets/InsetIPA.cpp
index 3876358..84caac2 100644
--- a/src/insets/InsetIPA.cpp
+++ b/src/insets/InsetIPA.cpp
@@ -151,7 +151,7 @@ void InsetIPA::reloadPreview(DocIterator const & pos) const
 void InsetIPA::draw(PainterInfo & pi, int x, int y) const
 {
 	if (previewState(pi.base.bv)) {
-		preview_->draw(pi, x + TEXT_TO_INSET_OFFSET, y);
+		preview_->draw(pi, x, y);
 		setPosCache(pi, x, y);
 		return;
 	}
@@ -181,15 +181,12 @@ void InsetIPA::metrics(MetricsInfo & mi, Dimension & dim) const
 {
 	if (previewState(mi.base.bv)) {
 		preview_->metrics(mi, dim);
-		mi.base.textwidth += 2 * TEXT_TO_INSET_OFFSET;
-		
+
 		dim.wid = max(dim.wid, 4);
 		dim.asc = max(dim.asc, 4);
-		
+
 		dim.asc += TEXT_TO_INSET_OFFSET;
 		dim.des += TEXT_TO_INSET_OFFSET;
-		dim.wid += TEXT_TO_INSET_OFFSET;
-		dim.wid += TEXT_TO_INSET_OFFSET;
 		// insert a one pixel gap
 		dim.wid += 1;
 		// Cache the inset dimension.
diff --git a/src/insets/InsetPreview.cpp b/src/insets/InsetPreview.cpp
index 53cfb23..334a8f2 100644
--- a/src/insets/InsetPreview.cpp
+++ b/src/insets/InsetPreview.cpp
@@ -138,7 +138,7 @@ void InsetPreview::draw(PainterInfo & pi, int x, int y) const
 {
 	if (previewState(pi.base.bv)) {
 		// one pixel gap in front
-		preview_->draw(pi, x + 1 + TEXT_TO_INSET_OFFSET, y);
+		preview_->draw(pi, x + 1, y);
 		setPosCache(pi, x, y);
 	} else
 		InsetText::draw(pi, x, y);
@@ -167,15 +167,12 @@ void InsetPreview::metrics(MetricsInfo & mi, Dimension & dim) const
 {
 	if (previewState(mi.base.bv)) {
 		preview_->metrics(mi, dim);
-		mi.base.textwidth += 2 * TEXT_TO_INSET_OFFSET;
 
 		dim.wid = max(dim.wid, 4);
 		dim.asc = max(dim.asc, 4);
 
 		dim.asc += TEXT_TO_INSET_OFFSET;
 		dim.des += TEXT_TO_INSET_OFFSET;
-		dim.wid += TEXT_TO_INSET_OFFSET;
-		dim.wid += TEXT_TO_INSET_OFFSET;
 		// insert a one pixel gap
 		dim.wid += 1;
 		// Cache the inset dimension.
-- 
2.7.4

Reply via email to