Markers for SVG


I’ve implemented Markers for SVG output. It’s coded around the 4.0 code base, but should cut + paste to all root versions.

The modified methods are the two versions of TSVG::DrawPolyMarker.

It could do with a bit of refactoring, but I didn’t want to make any header changes. :wink:

I’ve attached the modified TSVG.cxx.

TSVG.cxx (43.8 KB)

Hi Tony,

Thanks for your contribution. I have put it in TSVG.cxx. Only a few mods were needed:

  • there was compilation warnings because you gave a Float argument to WriteInteger
  • there was unused variables
  • some invalid code appeared in the SVG file because SetColor was called outside < >
  • the filled markers were not implemented.

Cheers, Olivier

Thanks for that Olivier.

I’ll check over my code - thought I’d got all the int warnings.

Didn’t notice any SVG errors (I’m using Batik to validate), so again I’ll have another check.


Had another check - you’re absolutely right :wink:

Thanks again

There was a code “black” outside < > because you called SetFillColor(1) at the begining of DrawPolymarker. I found it by looking at the SVG generated not because an SVG viewer gave me an error. It seems SVG viewers (like batik) ignore it but nevertheless it is wrong.

I found the warnings compiling on Linux with g++.