Re: rendering-cleanup-next



Hi,

On Sun, Sep 12, 2010 at 5:05 PM, Matthias Clasen
<matthias clasen gmail com> wrote:
> Also, the idea to separate the translation and the size in
> size_allocate is intriguing.
>

A prior art thing I thought of that's relevant, Clutter has the
translation transform *and* the allocation origin.

The clutter model is that there's a transform (a full matrix, 3D of
course not 2D as in Cairo) which only affects painting (first you do
layout, then you can transform when painting so the actor need not
paint inside its allocation).

I guess the allocation.x,y translation is conceptually part of the
allocation (or part of layout). The thing is that the x,y is only of
interest to the parent layout container, while the width,height is
also of interest to the child. With adjust_size_allocation, though,
child-interesting allocation doesn't really match what the parent
assigned anyhow. So gtk_widget_size_allocate() (assigning allocation)
could take raw allocation including x,y and then the virtual method
(going to child) gets adjusted allocation with no x,y perhaps. The x,y
could be handled with no virtualization i.e. just stored by GtkWidget
rather than storing it in the size_allocate default handler. Widget
implementations could never look at GtkAllocation, only at
get_allocated_width/height (whatever that would be called). Container
implementations would look at GtkAllocation of their children though.

Havoc


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