On Fri, Nov 25, 2005 at 10:54:06AM +0100, Tavmjong Bah wrote:
Coming from a science background, I couldn't agree more.
5/ Arrows are important and svg markers are great. They could be even better if they followed the style of the stroke they are applied to.
Yes, this is something I am personally interested in working on. I've dug into the code and know exactly what needs to be coded; I just haven't had a good solid stretch of freetime to work on it. (The test harness has been a higher priority.) Again, if someone else would like to get involved in doing some C++ coding deep in Inkscape's guts, I'd be more than happy to share my notes and help get you started. If no one else does, I'll get to this eventually, but be patient as it may be a while...
Bryce, I might be interested in implementing this. I've looked a bit at the code but would probably need some help to understand it fully. Can you outline what you think needs to be done? How would the use of style sheets effect this? And SVG 1.2 shadowInherit?
Sure, here's an outline of the steps I'd thought to take:
2. Cleanup * Improve documentation of marker code * Fix bug 1298718 - marker changes in xml editor don't immediately affect drawin * Fix bug 980157 - marker menus don't update on the change in document markers * FIXME in stock-items.cpp for sp_marker_load_from_svg * Remove all the marker_status stuff * Rename sp-marker.* to marker.*
3. Color Inheritance * Ensure that currentStroke, currentFill, and shadowInherit are in style-test.cpp, attributes-test.cpp and attributes.cpp * Ensure the following is parsed without generating errors: <marker shadowInherit="onUse" fill="currentStroke" id="something" ... /> * Find where markers are initially applied to a line - sp_copy_stuff_used_by_item (s/stuff/defs/?) - Add a check for the current line color - Add a marker ref pointing to the geom of the desired marker - Apply the correct style to the marker * Test on http://inkscape.org/wiki_uploads/xlink_marker.svg) * Implement option on the Stroke Style dialog for preventing marker from inheriting line style * Add shadowInherit property to sp-marker.h * Add support for shadowInherit, with values: - onDefine - like current behavior - onUse - what we want - dynamic - not sure... - none - don't know this one either * set default shadowInherit as follows: - for images, default is 'none' - for feImage, default is 'dynamic' - for pattern and marker, default is 'onDefine' * Add support for currentFill/currentStroke * Ensure when selecting a new marker, it re-colors appropriately
I've also got some tasks outlined for future work including 4. Make marker size settable, 5. Make xlink:href work on markers, 6. Marker selection UI, 7. Marker snapping/connecting improvement, and 8. On canvas marker editing, but I think the color style is the highest priority.
Another change would be to allow scaling the marker size relative to (or independently of?) the stroke width. This should be relatively easy to add if one can get the color to match since in both cases it appears to me that a copy of the marker must be stored in the def section. This would allow the elimination of the three different sizes for each marker type.
Right, see RFE 942486 for details. I think the UI for doing this would be the challenging part, but agree it's necessary if we want to allow a wider variety of markers, as having non-scalable markers is, er... not scalable.
As a side note, there appears to be a problem with the current marker code. In looking at what needs to be done I copied the example code from:
http://www.w3.org/TR/SVG/painting.html#Markers
There are two versions, one using markers and one not, simulating what how the marker is drawn. Inkscape renders the two differently. The marker version is wrong according to the picture on the website. FireFox 1.5 renders them both the same. Doing a little research it appears that Inkscape does not use the viewBox attribute.
Hmm, can you enter a bug on this one, if we don't already have one in the tracker? This sounds fairly important.
Bryce