Re: function to resize a UML class object's extent?



Le mer, nov 28, 2001, à 09:17:29 -0700, Andrew S . Halper a écrit:

Well, it should happen automatically when set_props is called.  That it
doesn't is a problem in object.c, or possibly deeper, in the properties.
The text is a sub-object, and its width doesn't get updated after
set_props.  The update_data function doesn't update the width of the text
object, obviously that object is expected to handle it itself.  But somehow
the text change is propagated to the text object without the width being
set?  I'm a little confused about this.  Your code looks good to me.
Cyrille, do you have any comments on the property updates?

Dinking around in gdb in a feeble attempt to understand the code, I find, on the
last line of lib/boundingbox.c:

/* TODO: text_bbox ? */

after which I said "Chepelov!" in the way Jerry used to say "Newman!" on
Seinfeld.

Uh-oh...

(trying to sync). Which object is concerned with the problem ?

I *think* I hadn't written an explicit text_bbox routine, because it would
be basically an alias for text_calc_boundingbox() (it may be a good thing to
add an inline at the end of lib/boundingbox.h for symmetry's sake). Or maybe
it would be more something like:

void text_bbox(/* const */ Text *text,
               const ElementBBExtras *extra,
               Rectangle *rout) 
{
   text_calc_boundingbox(text,rout); 
   if (!extra) return;
   rout->left -= extra->border_trans;   
   rout->top -= extra->border_trans;    
   rout->right += extra->border_trans;  
   rout->bottom += extra->border_trans; 
}

All would be missing, then, would be to plus that in the relevant update
function (again, which object ?)

        -- Cyrille

-- 
Grumpf.




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