Re: Design proposal: WAS: Re: updateBackgroundColor mechanism is badly flawed

From: Martin Sevior (
Date: Mon Jul 29 2002 - 22:27:00 EDT

  • Next message: Martin Sevior: "Re: commit: speedup fl_DocSectionLayout::redrawUpdate()"

    On Tue, 2002-07-30 at 00:25, j.m.maurer wrote:
    > Op ma 29-07-2002, om 15:47 schreef Tomas Frydrych:
    > >
    > > The updateBackgroundColor mechanism seems to be very seriously
    > > flawed and needs to be rewritten, as it is one of the main bottlenecks
    > > in the code.
    > >
    > > The problem is this: the various calls to updateBackgroundColor()
    > > propagate down to the run level, where
    > > fp_Run::updateBackgroundColor() querries the PieceTable (!!!) for
    > > the background colour property. This is not the way it should be --
    > I know this is not the right way to do stuff, but at this moment, it's
    > the only way to do it. It is needed for text that is within a table
    > cell: when a run clears a region that needs to be cleared, it does so
    > using the background color of the page, or the currently set highlight
    > color. The problem is: it must use the current cell background color if
    > the text is in a cell that has a background color set!
    > My proposal is (and i've already discussed this a bit with Martin and
    > Dom), that the run (or whatever container) should NOT clear the region
    > itself, but the container it is in (it's parent container) should clear
    > the region. If that container does not know how clear the region, then
    > it's parent container should clear the region.

    Actually this is exactly the opposite of what I want. I want the run to
    clear itself. I don't agree with this.

    > (I guess this sounds incomprehenisble(?)...)
    > Take for example a table cell that has an *image* set as a background
    > (which we currently cannot do). When a run in that cell wants to clear a
    > region, it uses the highlight color, the page color or the cell
    > background color as described above. Of course this is WRONG!

    Yes. it is. The run should look to see if has a background colour, if it
    does, it should use that. If not it should use the containers background
    colour, if that is transperent it use the containers container, etc
    until it reaches the top level column.

    The region
    > must be cleared with the image contents of that region! So, the run
    > should propagate it's request up to the cell, which knows it has an
    > image as a background. The cell would finally ask the image to repaint
    > the specific region the run requested...
    > Is this the way to go, or doesn't it make sense?

    In my opinion this is part of the way to go but not the whole way. We
    want to support background images at all levels. From shading in
    paragraphs to images that cover a whole page. The only to do this
    successfully is for each run to paint the SEGMENT of the image it
    covers. So the runs should the paint the image on information provided
    by it's container.



    This archive was generated by hypermail 2.1.4 : Mon Jul 29 2002 - 22:41:17 EDT