fenfire-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fenfire-dev] darcs patch


From: Benja Fallenstein
Subject: Re: [Fenfire-dev] darcs patch
Date: Tue, 14 Dec 2004 09:37:55 +0100
User-agent: Mozilla Thunderbird 0.9 (X11/20041124)

Hi Tuukka,

thanks for the patch! Applied (with some small twids, see fencommits).

Tuukka Hastrup wrote:
I know these aren't implemented correctly, but they work for me in FenFeed. Took me some 12 hours to get this far,

:-/

so now please tell what I did wrong :-)

Actually, it's good except for ugliness of having the visibleFractionModel in ViewportLob, which is probably what you're referring to. Even that's a reasonable compromise if you shy away from introducting new lobs, though. ;-) The better solution would be--

> Particularily, getting Lob sizings as Models would be helpful.

--by using wrapper lobs that do that, like this:

    AssignedSizeGetterLob
             |
        ViewportLob
             |
   PreferredSizeGetterLob
             |
         (content)

(I have a hard time coming up with good names for these, any improvements appreciated!)

Each of these would have two float models, one for each axis. AssignedSizeGetterLob would, when setSize is called, write the size assignment into its models; PreferredSizeGetterLob would, when constructed and when chg() is called (which is how children notify parent lobs of changes in size request), request the child's preferred size and write it into its models.

These would extend AbstractMonoLob.

AssignedSizeGetterLob will also have an application in a redesign of Breaker I'm planning, which will move the linebreaking code into a SequenceModel. Then the current Breaker(textmodel) will look like this:

    AssignedSizeGetterLob(xmodel, ymodel, content =
        Box(Y, model =
            LinebreakingModel(model = textmodel, width = xmodel)
        )
    )

-- i.e., the linewidth, which is a parameter to LinebreakingModel, will be set by AssignedSizeGetterLob.

I'm too lazy to implements AssignedSGL and PreferredSGL now -- you can do it if you like, otherwise it stays ugly for now :-)

- Benja




reply via email to

[Prev in Thread] Current Thread [Next in Thread]