a) the guys who implemented it weren't aware of that this is possible
b) there are some use cases that break if you are doing this, which are not obvious
Some months ago I also tried to avoid some flickering issues on resizing. But I needed to reset my changes as there were other use cases where NatTables rendering was broken then.
Can't tell you what the real reason is or if your proposal wouldn't have any side effects. I can try to add your code and play around with our examples. If nothing is broken afterwards, I can add it to NatTable core.
If I'm adding your proposed addition to the NatLayerPainter, the AutomaticRowHeightExample starts flickering a lot in the bounds. Even if the resize is done, the flickering appears.
So I really don't know the reasons, but your change breaks the almost clean behaviour in NatTable. IMHO some flickering on resize (which is not really flickering but inconsistent rendering at resize time) is better than real flickering if nothing is done.
Let me know if you have another idea. We are open for enhancements as long as NatTable 1.x is in active development.
The million question for now is:
Is a redraw(false) call the wrong approach or do we have an other issue to solve? The 'org.eclipse.scout.rt.ui.swt.basic.table.painter.patched.TextPainter.paintCell(ILayerCell, GC, Rectangle, IConfigRegistry)' method gets called "forever and ever again" in this example. Try to find the scheduler of these paint events...
Not sure if it is worth searching for the solution on this quite internal stuff. We will definitely have a closer look at the rendering in the next architecture, but for now it seems to work for most of the cases. Of course, if you want to try to find the issue, good luck.
For your use case that row heights should also shrink automatically, maybe a different approach than letting the painter doing the row resizing could fit. What about attaching a listener for client area resizes. And after that you perform automatic resizing for all rows. Have a look here for some examples on automatic resizing http://eclipse.org/nattable/documentation.php?page=faq
For large tables this might be not the most performant solution, but this way you should avoid the flickering and minimize the resizing commands/events on rendering.