On 2010-04-25 at 16:46:54 [+0200], Jérôme Duval <korli@xxxxxxxxxxxxxxxx> wrote: > 2010/4/25 <superstippi@xxxxxx>: > > + // Make sure that the dirty area outside the text is redrawn too. > > + BRegion invalid(oldTextRect | fTextRect); > > + invalid.Exclude(fTextRect); > > Is the resulting invalid region the same with the following ? > > BRegion invalid(oldTextRect); > invalid.Exclude(fTextRect); Actually no. Here's an illustration. O = old, X = new: Layout of O versus X: OOOOOOOOOOOOOOO OXXXXXXXXXXXXXXX OXXXXXXXXXXXXXXX OXXXXXXXXXXXXXXX OXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX O | X: OOOOOOOOOOOOOOO+ OXXXXXXXXXXXXXXX OXXXXXXXXXXXXXXX OXXXXXXXXXXXXXXX OXXXXXXXXXXXXXXX +XXXXXXXXXXXXXXX +XXXXXXXXXXXXXXX Region: OOOOOOOOOOOOOOO+ O O O O + + In your proposal, only the Os would be left above, not the +s. For the case at hand, it may still be the desired result, though, but I am not sure. Best regards, -Stephan