From 75ba515b18282881fc351ebd4fffbee95e08a94e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 7 Apr 2004 16:54:15 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8621 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/command_inset.C | 1 + src/mathed/math_amsarrayinset.C | 1 + src/mathed/math_arrayinset.C | 1 + src/mathed/math_binaryopinset.C | 1 + src/mathed/math_binominset.C | 10 ++++++---- src/mathed/math_braceinset.C | 12 +++++++----- src/mathed/math_casesinset.C | 7 ++++--- src/mathed/math_casesinset.h | 2 +- src/mathed/math_colorinset.C | 1 + src/mathed/math_dfracinset.C | 1 + src/mathed/math_fboxinset.C | 1 + src/mathed/math_fracinset.C | 10 ++++++---- src/mathed/math_frameboxinset.C | 1 + src/mathed/math_hullinset.C | 1 + src/mathed/math_macro.C | 1 + src/mathed/math_macroarg.C | 1 + src/mathed/math_macrotemplate.C | 1 + src/mathed/math_makeboxinset.C | 1 + src/mathed/math_mboxinset.C | 1 + src/mathed/math_nestinset.C | 4 ++-- src/mathed/math_oversetinset.C | 1 + src/mathed/math_textinset.C | 1 + src/mathed/math_undersetinset.C | 10 ++++++---- 23 files changed, 48 insertions(+), 23 deletions(-) diff --git a/src/mathed/command_inset.C b/src/mathed/command_inset.C index eaf57d6230..1e06d46268 100644 --- a/src/mathed/command_inset.C +++ b/src/mathed/command_inset.C @@ -51,6 +51,7 @@ void CommandInset::metrics(MetricsInfo & mi, Dimension & dim) const void CommandInset::draw(PainterInfo & pi, int x, int y) const { button_.draw(pi, x, y); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_amsarrayinset.C b/src/mathed/math_amsarrayinset.C index 561faa2248..6fdca3e708 100644 --- a/src/mathed/math_amsarrayinset.C +++ b/src/mathed/math_amsarrayinset.C @@ -85,6 +85,7 @@ void MathAMSArrayInset::draw(PainterInfo & pi, int x, int y) const int const yy = y - dim_.ascent(); mathed_draw_deco(pi, x + 1, yy, 5, dim_.height(), name_left()); mathed_draw_deco(pi, x + dim_.width() - 6, yy, 5, dim_.height(), name_right()); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_arrayinset.C b/src/mathed/math_arrayinset.C index 1520ec5385..9e1ea21f42 100644 --- a/src/mathed/math_arrayinset.C +++ b/src/mathed/math_arrayinset.C @@ -84,6 +84,7 @@ void MathArrayInset::metrics(MetricsInfo & mi, Dimension & dim) const void MathArrayInset::draw(PainterInfo & pi, int x, int y) const { + setPosCache(pi, x, y); ArrayChanger dummy(pi.base); MathGridInset::draw(pi, x + 1, y); } diff --git a/src/mathed/math_binaryopinset.C b/src/mathed/math_binaryopinset.C index 36bded271c..ce6dc2c5ac 100644 --- a/src/mathed/math_binaryopinset.C +++ b/src/mathed/math_binaryopinset.C @@ -55,6 +55,7 @@ void MathBinaryOpInset::metrics(MetricsInfo & mi, Dimension & dim) const } #endif + void MathBinaryOpInset::draw(PainterInfo & pain, int x, int y) const { cell(0).draw(pain, x, y); diff --git a/src/mathed/math_binominset.C b/src/mathed/math_binominset.C index 69ff5aa98f..7e3016271a 100644 --- a/src/mathed/math_binominset.C +++ b/src/mathed/math_binominset.C @@ -47,10 +47,11 @@ void MathBinomInset::metrics(MetricsInfo & mi, Dimension & dim) const ScriptChanger dummy(mi.base); cell(0).metrics(mi); cell(1).metrics(mi); - dim_.asc = cell(0).height() + 4 + 5; - dim_.des = cell(1).height() + 4 - 5; - dim_.wid = max(cell(0).width(), cell(1).width()) + 2 * dw() + 4; - dim = dim_; + dim.asc = cell(0).height() + 4 + 5; + dim.des = cell(1).height() + 4 - 5; + dim.wid = max(cell(0).width(), cell(1).width()) + 2 * dw() + 4; + metricsMarkers2(dim); + dim_ = dim; } @@ -63,6 +64,7 @@ void MathBinomInset::draw(PainterInfo & pi, int x, int y) const mathed_draw_deco(pi, x, y - dim_.ascent(), dw(), dim_.height(), "("); mathed_draw_deco(pi, x + dim_.width() - dw(), y - dim_.ascent(), dw(), dim_.height(), ")"); + drawMarkers2(pi, x, y); } diff --git a/src/mathed/math_braceinset.C b/src/mathed/math_braceinset.C index aa7b914896..99bb5110d2 100644 --- a/src/mathed/math_braceinset.C +++ b/src/mathed/math_braceinset.C @@ -44,11 +44,12 @@ void MathBraceInset::metrics(MetricsInfo & mi, Dimension & dim) const cell(0).metrics(mi); Dimension t; mathed_char_dim(mi.base.font, '{', t); - wid_ = t.wid; - dim_.asc = max(cell(0).ascent(), t.asc); - dim_.des = max(cell(0).descent(), t.des); - dim_.wid = cell(0).width() + 2 * wid_; - dim = dim_; + dim.wid = t.wid; + dim.asc = max(cell(0).ascent(), t.asc); + dim.des = max(cell(0).descent(), t.des); + dim.wid = cell(0).width() + 2 * dim.wid; + metricsMarkers(dim); + dim_ = dim; } @@ -59,6 +60,7 @@ void MathBraceInset::draw(PainterInfo & pi, int x, int y) const drawChar(pi, font, x, y, '{'); cell(0).draw(pi, x + wid_, y); drawChar(pi, font, x + dim_.width() - wid_, y, '}'); + drawMarkers(pi, x, y); } diff --git a/src/mathed/math_casesinset.C b/src/mathed/math_casesinset.C index 2a57697bd5..eaea9c43f5 100644 --- a/src/mathed/math_casesinset.C +++ b/src/mathed/math_casesinset.C @@ -39,10 +39,11 @@ void MathCasesInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathCasesInset::draw(PainterInfo & pain, int x, int y) const +void MathCasesInset::draw(PainterInfo & pi, int x, int y) const { - mathed_draw_deco(pain, x + 1, y - dim_.ascent(), 6, dim_.height(), "{"); - MathGridInset::draw(pain, x + 8, y); + mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 6, dim_.height(), "{"); + MathGridInset::draw(pi, x + 8, y); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_casesinset.h b/src/mathed/math_casesinset.h index bd112abb2f..9ee1fa1a8a 100644 --- a/src/mathed/math_casesinset.h +++ b/src/mathed/math_casesinset.h @@ -26,7 +26,7 @@ public: /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// - void draw(PainterInfo & pain, int x, int y) const; + void draw(PainterInfo & pi, int x, int y) const; /// void infoize(std::ostream & os) const; diff --git a/src/mathed/math_colorinset.C b/src/mathed/math_colorinset.C index f4aa3481bf..5a87a63f85 100644 --- a/src/mathed/math_colorinset.C +++ b/src/mathed/math_colorinset.C @@ -68,6 +68,7 @@ void MathColorInset::draw(PainterInfo & pi, int x, int y) const pi.base.font.setColor(lcolor.getFromGUIName(asString(cell(0)))); cell(1).draw(pi, x, y); pi.base.font.setColor(origcol); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_dfracinset.C b/src/mathed/math_dfracinset.C index b13bdc7119..33e3095735 100644 --- a/src/mathed/math_dfracinset.C +++ b/src/mathed/math_dfracinset.C @@ -51,6 +51,7 @@ void MathDfracInset::draw(PainterInfo & pi, int x, int y) const cell(0).draw(pi, m - cell(0).width() / 2, y - cell(0).descent() - 2 - 5); cell(1).draw(pi, m - cell(1).width() / 2, y + cell(1).ascent() + 2 - 5); pi.pain.line(x + 1, y - 5, x + dim_.wid - 2, y - 5, LColor::math); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_fboxinset.C b/src/mathed/math_fboxinset.C index 7411545fb4..54532bf8a3 100644 --- a/src/mathed/math_fboxinset.C +++ b/src/mathed/math_fboxinset.C @@ -63,6 +63,7 @@ void MathFboxInset::draw(PainterInfo & pi, int x, int y) const } else { cell(0).draw(pi, x + 5, y); } + setPosCache(pi, x, y); } diff --git a/src/mathed/math_fracinset.C b/src/mathed/math_fracinset.C index a326c41994..b694d72fe1 100644 --- a/src/mathed/math_fracinset.C +++ b/src/mathed/math_fracinset.C @@ -52,10 +52,11 @@ void MathFracInset::metrics(MetricsInfo & mi, Dimension & dim) const FracChanger dummy(mi.base); cell(0).metrics(mi); cell(1).metrics(mi); - dim_.wid = max(cell(0).width(), cell(1).width()) + 2; - dim_.asc = cell(0).height() + 2 + 5; - dim_.des = cell(1).height() + 2 - 5; - dim = dim_; + dim.wid = max(cell(0).width(), cell(1).width()) + 2; + dim.asc = cell(0).height() + 2 + 5; + dim.des = cell(1).height() + 2 - 5; + metricsMarkers(dim); + dim_ = dim; } @@ -68,6 +69,7 @@ void MathFracInset::draw(PainterInfo & pi, int x, int y) const cell(1).draw(pi, m - cell(1).width() / 2, y + cell(1).ascent() + 2 - 5); if (!atop_) pi.pain.line(x + 1, y - 5, x + dim_.wid - 2, y - 5, LColor::math); + drawMarkers(pi, x, y); } diff --git a/src/mathed/math_frameboxinset.C b/src/mathed/math_frameboxinset.C index ebeccae203..805e217cf5 100644 --- a/src/mathed/math_frameboxinset.C +++ b/src/mathed/math_frameboxinset.C @@ -66,6 +66,7 @@ void MathFrameboxInset::draw(PainterInfo & pi, int x, int y) const x += w_ + 4; cell(2).draw(pi, x, y); + drawMarkers(pi, x, y); } diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 8711f62420..c834db104d 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -242,6 +242,7 @@ void MathHullInset::draw(PainterInfo & pi, int x, int y) const drawStr(pi, pi.base.font, xx, yy, nicelabel(row)); } } + setPosCache(pi, x, y); } diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 98b792fbc2..50e30927e0 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -140,6 +140,7 @@ void MathMacro::draw(PainterInfo & pi, int x, int y) const } expanded_.draw(pi, x, y); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_macroarg.C b/src/mathed/math_macroarg.C index 5073c37087..655ff52932 100644 --- a/src/mathed/math_macroarg.C +++ b/src/mathed/math_macroarg.C @@ -62,6 +62,7 @@ void MathMacroArgument::draw(PainterInfo & pi, int x, int y) const cell(0).draw(pi, x, y); else drawStrRed(pi, x, y, str_); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_macrotemplate.C b/src/mathed/math_macrotemplate.C index 30290a466c..b24c59d0d5 100644 --- a/src/mathed/math_macrotemplate.C +++ b/src/mathed/math_macrotemplate.C @@ -101,6 +101,7 @@ void MathMacroTemplate::draw(PainterInfo & pi, int x, int y) const cell(1).draw(pi, x + 8 + w0, y + 1); pi.pain.rectangle(x + w0 + 6 , y - dim_.ascent() + 1, w1 + 4, dim_.height(), LColor::mathline); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_makeboxinset.C b/src/mathed/math_makeboxinset.C index 7154dfff7a..9c16adc0ce 100644 --- a/src/mathed/math_makeboxinset.C +++ b/src/mathed/math_makeboxinset.C @@ -65,6 +65,7 @@ void MathMakeboxInset::draw(PainterInfo & pi, int x, int y) const x += w_ + 2; cell(2).draw(pi, x, y); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_mboxinset.C b/src/mathed/math_mboxinset.C index eaaad2c1d0..671c932249 100644 --- a/src/mathed/math_mboxinset.C +++ b/src/mathed/math_mboxinset.C @@ -54,6 +54,7 @@ void MathMBoxInset::draw(PainterInfo & pi, int x, int y) const { text_.draw(pi, x + 1, y); drawMarkers(pi, x, y); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 43c81668e0..e99bd172a1 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -181,14 +181,14 @@ void MathNestInset::dump() const } -//void MathNestInset::draw(PainterInfo & pi, int x, int y) const -void MathNestInset::draw(PainterInfo &, int, int) const +void MathNestInset::draw(PainterInfo & pi, int x, int y) const { #if 0 if (lock_) pi.pain.fillRectangle(x, y - ascent(), width(), height(), LColor::mathlockbg); #endif + setPosCache(pi, x, y); } diff --git a/src/mathed/math_oversetinset.C b/src/mathed/math_oversetinset.C index b16f4b2c7c..7f2eb16381 100644 --- a/src/mathed/math_oversetinset.C +++ b/src/mathed/math_oversetinset.C @@ -44,6 +44,7 @@ void MathOversetInset::draw(PainterInfo & pi, int x, int y) const cell(1).draw(pi, m - cell(1).width() / 2, y); FracChanger dummy(pi.base); cell(0).draw(pi, m - cell(0).width() / 2, yo); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_textinset.C b/src/mathed/math_textinset.C index 952692be28..9219d99523 100644 --- a/src/mathed/math_textinset.C +++ b/src/mathed/math_textinset.C @@ -184,6 +184,7 @@ void MathTextInset::metrics(MetricsInfo & mi, Dimension & dim) const void MathTextInset::draw(PainterInfo & pi, int x, int y) const { cache_.draw(pi, x + 1, y); + setPosCache(pi, x, y); } diff --git a/src/mathed/math_undersetinset.C b/src/mathed/math_undersetinset.C index 74b8f0494d..659cdc6341 100644 --- a/src/mathed/math_undersetinset.C +++ b/src/mathed/math_undersetinset.C @@ -31,10 +31,11 @@ void MathUndersetInset::metrics(MetricsInfo & mi, Dimension & dim) const cell(1).metrics(mi); FracChanger dummy(mi.base); cell(0).metrics(mi); - dim_.wid = max(cell(0).width(), cell(1).width()) + 4; - dim_.asc = cell(1).ascent(); - dim_.des = cell(1).descent() + cell(0).height() + 4; - dim = dim_; + dim.wid = max(cell(0).width(), cell(1).width()) + 4; + dim.asc = cell(1).ascent(); + dim.des = cell(1).descent() + cell(0).height() + 4; + metricsMarkers(dim); + dim_ = dim; } @@ -45,6 +46,7 @@ void MathUndersetInset::draw(PainterInfo & pi, int x, int y) const cell(1).draw(pi, m - cell(1).width() / 2, y); FracChanger dummy(pi.base); cell(0).draw(pi, m - cell(0).width() / 2, yo); + drawMarkers(pi, x, y); } -- 2.39.2