+
+ // this is the first thing we have to ask because if the x pos
+ // changed we have to do a complete rebreak of the text as we
+ // may have few space to draw in. Well we should check on this too
+ int old_x = top_x;
+ if (top_x != int(x)) {
+ top_x = int(x);
+ int nw = getMaxWidth(bv, this);
+ if (nw > 0 && old_max_width != nw) {
+ need_update = INIT;
+ old_max_width = nw;
+ bv->text->status(bv, LyXText::CHANGED_IN_DRAW);
+ return;
+ } else {
+ top_x = old_x;
+ }
+ }
+
+ // repaint the background if needed
+ if (cleared && backgroundColor() != LColor::background) {
+ top_x = int(x);
+ clearInset(pain, baseline, cleared);
+ top_x = old_x;
+ }