mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
use Length::inPixel and not Length::inBP to get screen lengths
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26441 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b0a3273bac
commit
b23bdfa00b
@ -89,7 +89,7 @@ public:
|
||||
std::string const asLatexString() const;
|
||||
/// return the on-screen size of this length
|
||||
int inPixels(int text_width, int em_width = 0) const;
|
||||
/// return the on-screen size of this length of an image
|
||||
/// return the value in Big Postscript points.
|
||||
int inBP() const;
|
||||
|
||||
friend bool isValidLength(std::string const & data, Length * result);
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "FuncRequest.h"
|
||||
|
||||
#include "frontends/Clipboard.h"
|
||||
#include "frontends/FontMetrics.h"
|
||||
#include "frontends/Painter.h"
|
||||
|
||||
#include "support/debug.h"
|
||||
@ -80,9 +81,11 @@ InsetMathGrid::RowInfo::RowInfo()
|
||||
|
||||
|
||||
|
||||
int InsetMathGrid::RowInfo::skipPixels() const
|
||||
int InsetMathGrid::RowInfo::skipPixels(MetricsInfo const & mi) const
|
||||
{
|
||||
return crskip_.inBP();
|
||||
frontend::FontMetrics const & fm = theFontMetrics(mi.base.font);
|
||||
return crskip_.inPixels(mi.base.textwidth,
|
||||
fm.width(char_type('M')));
|
||||
}
|
||||
|
||||
|
||||
@ -367,7 +370,7 @@ void InsetMathGrid::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
rowinfo_[row].offset_ =
|
||||
rowinfo_[row - 1].offset_ +
|
||||
rowinfo_[row - 1].descent_ +
|
||||
rowinfo_[row - 1].skipPixels() +
|
||||
rowinfo_[row - 1].skipPixels(mi) +
|
||||
rowsep() +
|
||||
rowinfo_[row].lines_ * hlinesep() +
|
||||
rowinfo_[row].ascent_;
|
||||
@ -550,7 +553,7 @@ void InsetMathGrid::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
|
||||
rowinfo_[row].offset_ =
|
||||
rowinfo_[row - 1].offset_ +
|
||||
rowinfo_[row - 1].descent_ +
|
||||
//rowinfo_[row - 1].skipPixels() +
|
||||
//rowinfo_[row - 1].skipPixels(mi) +
|
||||
1 + //rowsep() +
|
||||
//rowinfo_[row].lines_ * hlinesep() +
|
||||
rowinfo_[row].ascent_;
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
///
|
||||
RowInfo();
|
||||
///
|
||||
int skipPixels() const;
|
||||
int skipPixels(MetricsInfo const & mi) const;
|
||||
/// cached descent
|
||||
mutable int descent_;
|
||||
/// cached ascent
|
||||
|
Loading…
Reference in New Issue
Block a user