+
+void MathedArray::shrink(int pos1, int pos2)
+{
+ if (pos1 == 0 && pos2 >= last())
+ return;
+
+ short fc = 0;
+ if (pos1 > 0 && bf_[pos1] > ' ') {
+ for (int p = pos1; p >= 0; --p) {
+ if (MathIsFont(bf_[p])) {
+ if (p != pos1 - 1)
+ fc = bf_[p];
+ else
+ --pos1;
+ break;
+ }
+ }
+ }
+
+ if (pos2 > 0 && bf_[pos2] >= ' ' && MathIsFont(bf_[pos2 - 1]))
+ --pos2;
+
+ int dx = pos2 - pos1;
+ MathedArray a;
+ a.resize(dx + 1);
+ strange_copy(&a, (fc) ? 1 : 0, pos1, dx);
+ if (fc) {
+ a[0] = fc;
+ ++dx;
+ }
+ a.last(dx);
+ a[dx] = '\0';
+
+ swap(a);
+ deep_copy();
+}
+
+