mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
Remove horizontal spacing around previews
This concerns the preview version of InsetPreview and InsetIPA. Fixes bug #10304.
This commit is contained in:
parent
e7a33cacf1
commit
4ddad2f6cd
@ -151,7 +151,7 @@ void InsetIPA::reloadPreview(DocIterator const & pos) const
|
|||||||
void InsetIPA::draw(PainterInfo & pi, int x, int y) const
|
void InsetIPA::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
if (previewState(pi.base.bv)) {
|
if (previewState(pi.base.bv)) {
|
||||||
preview_->draw(pi, x + TEXT_TO_INSET_OFFSET, y);
|
preview_->draw(pi, x, y);
|
||||||
setPosCache(pi, x, y);
|
setPosCache(pi, x, y);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -181,15 +181,12 @@ void InsetIPA::metrics(MetricsInfo & mi, Dimension & dim) const
|
|||||||
{
|
{
|
||||||
if (previewState(mi.base.bv)) {
|
if (previewState(mi.base.bv)) {
|
||||||
preview_->metrics(mi, dim);
|
preview_->metrics(mi, dim);
|
||||||
mi.base.textwidth += 2 * TEXT_TO_INSET_OFFSET;
|
|
||||||
|
|
||||||
dim.wid = max(dim.wid, 4);
|
dim.wid = max(dim.wid, 4);
|
||||||
dim.asc = max(dim.asc, 4);
|
dim.asc = max(dim.asc, 4);
|
||||||
|
|
||||||
dim.asc += TEXT_TO_INSET_OFFSET;
|
dim.asc += TEXT_TO_INSET_OFFSET;
|
||||||
dim.des += 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
|
// insert a one pixel gap
|
||||||
dim.wid += 1;
|
dim.wid += 1;
|
||||||
// Cache the inset dimension.
|
// Cache the inset dimension.
|
||||||
|
@ -138,7 +138,7 @@ void InsetPreview::draw(PainterInfo & pi, int x, int y) const
|
|||||||
{
|
{
|
||||||
if (previewState(pi.base.bv)) {
|
if (previewState(pi.base.bv)) {
|
||||||
// one pixel gap in front
|
// 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);
|
setPosCache(pi, x, y);
|
||||||
} else
|
} else
|
||||||
InsetText::draw(pi, x, y);
|
InsetText::draw(pi, x, y);
|
||||||
@ -167,15 +167,12 @@ void InsetPreview::metrics(MetricsInfo & mi, Dimension & dim) const
|
|||||||
{
|
{
|
||||||
if (previewState(mi.base.bv)) {
|
if (previewState(mi.base.bv)) {
|
||||||
preview_->metrics(mi, dim);
|
preview_->metrics(mi, dim);
|
||||||
mi.base.textwidth += 2 * TEXT_TO_INSET_OFFSET;
|
|
||||||
|
|
||||||
dim.wid = max(dim.wid, 4);
|
dim.wid = max(dim.wid, 4);
|
||||||
dim.asc = max(dim.asc, 4);
|
dim.asc = max(dim.asc, 4);
|
||||||
|
|
||||||
dim.asc += TEXT_TO_INSET_OFFSET;
|
dim.asc += TEXT_TO_INSET_OFFSET;
|
||||||
dim.des += 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
|
// insert a one pixel gap
|
||||||
dim.wid += 1;
|
dim.wid += 1;
|
||||||
// Cache the inset dimension.
|
// Cache the inset dimension.
|
||||||
|
Loading…
Reference in New Issue
Block a user