Stefan Schimanski wrote:

Am 08.11.2007 um 10:20 schrieb Abdelrazak Younes:

Stefan Schimanski wrote:
Am 08.11.2007 um 09:33 schrieb Abdelrazak Younes:

By the way, about the monochrome mode, it seems that the mode could not be leaved after ArgumentProxy::draw():

void draw(PainterInfo & pi, int x, int y) const {
   if (mathMacro_.editing()) {
       pi.pain.leaveMonochromeMode();
       mathMacro_.cell(idx_).draw(pi, x, y);
       // FIXME: use real min/max colors here, not necessarely
       pi.pain.enterMonochromeMode(Color_mathbg,

Are we sure that the mode will be leaved in MathMacro::draw() in all cases?
What exactly do you mean? That the leaveMonochromeMode will have no effect under some circumstances and the "enter" will make it asymmetric?

Yes, basically I'm afraid that the painter stays in monochrome mode after leaving the macro.

Ok. By looking at the code the only way a MathProxy can appear is in a cell of the MathMacro. Moreover the cells are only drawn in the DISPLAY_FOLDED mode and then, in the case of "editing_ == true" the monochrome mode is entered by the MathMacro and then eventually left by the ArgumentProxy.

At least that's the idea. Everything else would be a bug in the implementation of this logic. So what about putting an assert there and make the code stable if such a bug appears, i.e. only calling "enter" if it was really left before?

Yep, this plus this very explanation within a comment would be nice :-P

Abdel.

Reply via email to