mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
fix drawing of mathrels. make \| equivalent to \Vert instead of \parallel
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2949 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
cf629f4331
commit
49295aa9be
@ -34,6 +34,8 @@ General hints for bug reports:
|
|||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
- \matrm{xy} gets written as \mathrm{x}\mathrm{y}
|
||||||
|
|
||||||
Dekel:
|
Dekel:
|
||||||
|
|
||||||
Macros:
|
Macros:
|
||||||
|
@ -127,26 +127,6 @@ enum MathSymbolTypes {
|
|||||||
LMB_RELATION,
|
LMB_RELATION,
|
||||||
///
|
///
|
||||||
LMB_OPERATOR,
|
LMB_OPERATOR,
|
||||||
///
|
|
||||||
LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/// Paragraph permissions
|
|
||||||
enum MathParFlag {
|
|
||||||
LMPF_BASIC = 0,
|
|
||||||
/// If false can use a non-standard size
|
|
||||||
LMPF_FIXED_SIZE = 1,
|
|
||||||
/// If true can insert newlines
|
|
||||||
LMPF_ALLOW_CR = 2,
|
|
||||||
/// If true can use tabs
|
|
||||||
LMPF_ALLOW_TAB = 4,
|
|
||||||
/// If true can insert new columns
|
|
||||||
LMPF_ALLOW_NEW_COL = 8,
|
|
||||||
/// Smaller than current size (frac)
|
|
||||||
LMPF_SMALLER = 16,
|
|
||||||
/// Script size (subscript, stackrel)
|
|
||||||
LMPF_SCRIPT = 32
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -105,9 +105,9 @@ void MathMacro::metrics(MathMetricsInfo const & mi) const
|
|||||||
expanded_ = tmplate_->xcell(0);
|
expanded_ = tmplate_->xcell(0);
|
||||||
expanded_.data_.substitute(*this);
|
expanded_.data_.substitute(*this);
|
||||||
expanded_.metrics(mi_);
|
expanded_.metrics(mi_);
|
||||||
width_ = expanded_.width() + 6;
|
width_ = expanded_.width();
|
||||||
ascent_ = expanded_.ascent() + 3;
|
ascent_ = expanded_.ascent();
|
||||||
descent_ = expanded_.descent() + 3;
|
descent_ = expanded_.descent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ void MathMacro::draw(Painter & pain, int x, int y) const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
expanded_.draw(pain, x + 3, y);
|
expanded_.draw(pain, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ void MathMacroTable::builtinMacros()
|
|||||||
create("owns", 0, "\\ni");
|
create("owns", 0, "\\ni");
|
||||||
create("gets", 0, "\\leftarrow");
|
create("gets", 0, "\\leftarrow");
|
||||||
create("to", 0, "\\rightarrow");
|
create("to", 0, "\\rightarrow");
|
||||||
create("|", 0, "\\parallel");
|
create("|", 0, "\\Vert");
|
||||||
|
|
||||||
create("longleftrightarrow", 0, "\\leftarrow\\kern-6mu\\rightarrow");
|
create("longleftrightarrow", 0, "\\leftarrow\\kern-6mu\\rightarrow");
|
||||||
create("Longleftrightarrow", 0, "\\Leftarrow\\kern-6mu\\Rightarrow");
|
create("Longleftrightarrow", 0, "\\Leftarrow\\kern-6mu\\Rightarrow");
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "math_symbolinset.h"
|
#include "math_symbolinset.h"
|
||||||
#include "math_parser.h"
|
#include "math_parser.h"
|
||||||
|
#include "debug.h"
|
||||||
#include "support.h"
|
#include "support.h"
|
||||||
#include "support/LOstream.h"
|
#include "support/LOstream.h"
|
||||||
|
|
||||||
@ -7,7 +8,8 @@
|
|||||||
using std::ostream;
|
using std::ostream;
|
||||||
|
|
||||||
MathSymbolInset::MathSymbolInset(const latexkeys * l)
|
MathSymbolInset::MathSymbolInset(const latexkeys * l)
|
||||||
: sym_(l), h_(0) {}
|
: sym_(l), h_(0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
MathInset * MathSymbolInset::clone() const
|
MathInset * MathSymbolInset::clone() const
|
||||||
@ -69,18 +71,21 @@ void MathSymbolInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
ascent_ += h_;
|
ascent_ += h_;
|
||||||
descent_ -= h_;
|
descent_ -= h_;
|
||||||
}
|
}
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
if (sym_->id > 0 && sym_->id < 255 && math_font_available(LM_TC_SYMB))
|
if (sym_->id > 0 && sym_->id < 255 && math_font_available(LM_TC_SYMB))
|
||||||
mathed_char_dim(code2(), mi_, sym_->id, ascent_, descent_, width_);
|
mathed_char_dim(code2(), mi_, sym_->id, ascent_, descent_, width_);
|
||||||
else
|
else
|
||||||
mathed_string_dim(LM_TC_TEX, mi_, sym_->name, ascent_, descent_, width_);
|
mathed_string_dim(LM_TC_TEX, mi_, sym_->name, ascent_, descent_, width_);
|
||||||
}
|
}
|
||||||
|
if (isRelOp())
|
||||||
|
width_ += mathed_char_width(LM_TC_TEX, mi_, 'I');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathSymbolInset::draw(Painter & pain, int x, int y) const
|
void MathSymbolInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
|
if (isRelOp())
|
||||||
|
x += mathed_char_width(LM_TC_TEX, mi_, 'I') / 2;
|
||||||
MathTextCodes Code = code();
|
MathTextCodes Code = code();
|
||||||
if (sym_->latex_font_id > 0 && math_font_available(Code))
|
if (sym_->latex_font_id > 0 && math_font_available(Code))
|
||||||
drawChar(pain, Code, mi_, x, y - h_, sym_->latex_font_id);
|
drawChar(pain, Code, mi_, x, y - h_, sym_->latex_font_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user