]> git.lyx.org Git - features.git/commitdiff
* Call metrics of the parameters with the correct font in MathMacros, for example
authorStefan Schimanski <sts@lyx.org>
Thu, 16 Oct 2008 21:27:43 +0000 (21:27 +0000)
committerStefan Schimanski <sts@lyx.org>
Thu, 16 Oct 2008 21:27:43 +0000 (21:27 +0000)
  if they are in an index and should be drawn smaller.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26927 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/MathMacro.cpp

index e61a09f89d52b756cd3b6bca11221e4f7a4efc4d..fb05c7182e428f92681da14f584e4a012011e7ba 100644 (file)
@@ -60,13 +60,12 @@ public:
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const {
                mathMacro_.macro()->unlock();
-               if (!mathMacro_.editMetrics(mi.base.bv) 
+               mathMacro_.cell(idx_).metrics(mi, dim);
+
+               if (!mathMacro_.editMetrics(mi.base.bv)
                    && mathMacro_.cell(idx_).empty())
                        def_.metrics(mi, dim);
-               else {
-                       CoordCache & coords = mi.base.bv->coordCache();
-                       dim = coords.arrays().dim(&mathMacro_.cell(idx_));
-               }
+
                mathMacro_.macro()->lock();
        }
        ///
@@ -236,13 +235,18 @@ void MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const
        } else {
                LASSERT(macro_ != 0, /**/);
 
-               // metrics are computed here for the cells,
-               // in the proxy we will then use the dim from the cache
-               InsetMathNest::metrics(mi);
-               
-               // calculate metrics finally
+               // calculate metrics, hoping that all cells are seen
                macro_->lock();
                expanded_.cell(0).metrics(mi, dim);
+
+               // otherwise do a manual metrics call
+               CoordCache & coords = mi.base.bv->coordCache();
+               for (idx_type i = 0; i < nargs(); ++i) {
+                       if (!coords.arrays().has(&cell(i))) {
+                               Dimension tdim;
+                               cell(i).metrics(mi, tdim);
+                       }
+               }
                macro_->unlock();
 
                // calculate dimension with label while editing