Hoi Fred,
Fred Kiefer wrote:
The method setFont: is an instance method, there is no guaranty that it will
always be the same for all cells.
I made fontAttr re-calculated now. This should be safe.
Whiel trying to make infoFont and fontAttr non-static, I got puzzled and made
GWorkspace crash again, so let's move gradually.
The first thing: is infoFont actually needed? It is used aparently only for the
dots, but the whole cell should use its own font (also since it implements
setFont and re-sets fontAttr in there).
I thus removed infoFont from everywhere and substituted it with just [self
font] where needed, using NSCell's. This even saves memory :)
What do you think? It works, I just commited and you sure have seen the patch
flowing in.
I never commented on infoFont, as I don't understand it. I think it has nothing
to do with the dots handling and it is an italic font. Maybe you better revert
that change?
I think it is some kind of left-over. It is only used in calculations
where at the end, the standard text is used. I'm puzzled about the
italic too. I tested it in all view types and I see no harm.
I also don't quite see why the cuttitle method gets cached. This just
obscures the code and doesn't speed up much.
Well, the method is called for each cell in a browser thus it was thought to
cache it.
Still not very likely to be noticable.
I checked FSNTextCell and FSNBrowserCell, those methods get called
continuosly while scrolling. Thus during initial drawing the speed-up is
not worth it (with a couple of open views, I get less than 100 calls)
however while scrolling you get many.
I thus left in the caching, i just cleaned it up by making the names
more explicit and by initilializing them in -int and not +initialize.
Somehow you didn't pick up any of the suggestions I made, but tried
some different a bit dubious changes. Not sure what to make of that.
Sorry, I did commit things in pieces. Except the text-alignment where I
don't understand fully what you mean me to do, I think I implemented
them all.
For FSNTextCell fontAttr are needed also for the calculation of
titlesize, so "caching" titlesize+fontAttr as ivar makes sense to me.
Riccardo
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep