On Tue, 2004-04-06 at 11:28, Carl Hetherington wrote:
It seems that we have the SPItem class hierarchy (which contains SPMarker) and the repr tree, and that these are kept in sync with each other. So in which tree should I create my new marker object? AFAICS my alternatives are:
- Do a sp_repr_new ("marker"), add it to the defs repr, set up the
attributes using sp_repr_set_attr () etc. etc.
- Create a SPMarker, and set up its struct with the required bits.
So which should it be? And how to I propagate my changes from one tree to the other?
In general it's probably easier to create things in the SPRepr tree, since the SPObject layer will get updated automatically. That is normally the proper way, as well.
I've just tried the first approach above and it works fine, except that the arrow heads only appear when you re-load the file. I think this is because a SPMarker is never created / initialised.
The SPMarker will get created automatically.
Likely the SPShape upon which the markers are to be used is not getting updated when the markers are added, however. I'm not sure the marker code ever got updated to use the new URIReference facility.
See SPItem's usage of URIReference with clipping paths as an example (though, the CSS part of things there is slightly broken).
-mental