mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Correct drawing of the multline environment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1485 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
408b556ed9
commit
8ccdbef7a0
@ -1,3 +1,9 @@
|
|||||||
|
2001-02-12 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
|
* formula.C (LocalDispatch): Change the default action of
|
||||||
|
break-line to create an align* environment instead of eqnarray*.
|
||||||
|
|
||||||
|
* math_inset.C (Metrics): Correct drawing of the multline environment.
|
||||||
|
|
||||||
2001-02-12 André Pönitz <poenitz@htwm.de>
|
2001-02-12 André Pönitz <poenitz@htwm.de>
|
||||||
* array.[hC]: replace private variable maxsize_ with call
|
* array.[hC]: replace private variable maxsize_ with call
|
||||||
|
@ -76,6 +76,7 @@ MathedCursor * InsetFormula::mathcursor = 0;
|
|||||||
int MathedInset::df_asc;
|
int MathedInset::df_asc;
|
||||||
int MathedInset::df_des;
|
int MathedInset::df_des;
|
||||||
int MathedInset::df_width;
|
int MathedInset::df_width;
|
||||||
|
int MathedInset::workWidth;
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
@ -407,8 +408,9 @@ int InsetFormula::descent(BufferView *, LyXFont const &) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int InsetFormula::width(BufferView *, LyXFont const & f) const
|
int InsetFormula::width(BufferView * bv, LyXFont const & f) const
|
||||||
{
|
{
|
||||||
|
MathedInset::workWidth = bv->workWidth();
|
||||||
lfont_size = f.size();
|
lfont_size = f.size();
|
||||||
par->Metrics();
|
par->Metrics();
|
||||||
return par->Width(); //+2;
|
return par->Width(); //+2;
|
||||||
@ -418,6 +420,7 @@ int InsetFormula::width(BufferView *, LyXFont const & f) const
|
|||||||
void InsetFormula::draw(BufferView * bv, LyXFont const & f,
|
void InsetFormula::draw(BufferView * bv, LyXFont const & f,
|
||||||
int baseline, float & x, bool) const
|
int baseline, float & x, bool) const
|
||||||
{
|
{
|
||||||
|
MathedInset::workWidth = bv->workWidth();
|
||||||
Painter & pain = bv->painter();
|
Painter & pain = bv->painter();
|
||||||
// Seems commenting out solves a problem.
|
// Seems commenting out solves a problem.
|
||||||
LyXFont font = mathed_get_font(LM_TC_TEXTRM, LM_ST_TEXT);
|
LyXFont font = mathed_get_font(LM_TC_TEXTRM, LM_ST_TEXT);
|
||||||
@ -790,7 +793,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
|
|||||||
case LFUN_BREAKLINE:
|
case LFUN_BREAKLINE:
|
||||||
{
|
{
|
||||||
bv->lockedInsetStoreUndo(Undo::INSERT);
|
bv->lockedInsetStoreUndo(Undo::INSERT);
|
||||||
byte c = arg.empty() ? 'e' : arg[0];
|
byte c = arg.empty() ? '1' : arg[0];
|
||||||
mathcursor->Insert(c, LM_TC_CR);
|
mathcursor->Insert(c, LM_TC_CR);
|
||||||
if (!label.empty()) {
|
if (!label.empty()) {
|
||||||
mathcursor->setLabel(label);
|
mathcursor->setLabel(label);
|
||||||
|
@ -352,7 +352,7 @@ MathMatrixInset * create_multiline(short int type, int cols)
|
|||||||
case LM_OT_MULTLINE:
|
case LM_OT_MULTLINE:
|
||||||
case LM_OT_MULTLINEN:
|
case LM_OT_MULTLINEN:
|
||||||
columns = 1;
|
columns = 1;
|
||||||
align = "c"; // This is incorrect!
|
align = "C";
|
||||||
break;
|
break;
|
||||||
case LM_OT_MPAR:
|
case LM_OT_MPAR:
|
||||||
case LM_OT_MPARN:
|
case LM_OT_MPARN:
|
||||||
|
@ -263,6 +263,8 @@ class MathedInset {
|
|||||||
virtual void SetStyle(short st) { size = st; } // Metrics();
|
virtual void SetStyle(short st) { size = st; } // Metrics();
|
||||||
///
|
///
|
||||||
virtual void SetName(string const & n) { name = n; }
|
virtual void SetName(string const & n) { name = n; }
|
||||||
|
///
|
||||||
|
static int workWidth;
|
||||||
protected:
|
protected:
|
||||||
///
|
///
|
||||||
string name;
|
string name;
|
||||||
|
@ -468,6 +468,10 @@ void MathMatrixInset::Metrics()
|
|||||||
for (i = 1; i < nc; ++i)
|
for (i = 1; i < nc; ++i)
|
||||||
if (h_align[i] == 'R')
|
if (h_align[i] == 'R')
|
||||||
ws[i] += 10*df_width;
|
ws[i] += 10*df_width;
|
||||||
|
// Increase ws[i] for 'C' column
|
||||||
|
if (h_align[0] == 'C')
|
||||||
|
if (ws[0] < 7*workWidth/8)
|
||||||
|
ws[0] = 7*workWidth/8;
|
||||||
|
|
||||||
// Adjust local tabs
|
// Adjust local tabs
|
||||||
cxrow = row;
|
cxrow = row;
|
||||||
@ -491,6 +495,14 @@ void MathMatrixInset::Metrics()
|
|||||||
case 'R':
|
case 'R':
|
||||||
lf = ws[i] - cxrow->getTab(i);
|
lf = ws[i] - cxrow->getTab(i);
|
||||||
break;
|
break;
|
||||||
|
case 'C':
|
||||||
|
if (cxrow == row)
|
||||||
|
lf = 0;
|
||||||
|
else if (!cxrow->getNext())
|
||||||
|
lf = ws[i] - cxrow->getTab(i);
|
||||||
|
else
|
||||||
|
lf = (ws[i] - cxrow->getTab(i))/2;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
ww = (isvoid) ? lf : lf + cxrow->getTab(i);
|
ww = (isvoid) ? lf : lf + cxrow->getTab(i);
|
||||||
cxrow->setTab(i, lf + rg);
|
cxrow->setTab(i, lf + rg);
|
||||||
|
Loading…
Reference in New Issue
Block a user