Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8206

Fill style when exporting canvas as .tex is not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 6.08/00
    • None
    • Graphics
    • None
    • Linux

    Description

      I have a TBox filled with fill style 3003. When calling

      TCanvas::SaveAs("a.tex")

      the output file has no pattern defined for this TBox. When compiling with latex, I get an ugly black rectangle. This is the line in question:

      \draw [pattern=, pattern color=c] (3,1.8) rectangle (11.96,10.2);

      I suggest changing it to

      \draw [pattern=dots, draw opacity=0, pattern color=c] (3,1.8) rectangle (11.96,10.2);

      (The draw opacity has to be 0 to remove the border of the rectangle in tikz).

      The list of patterns supported by tikz is at page 217 of the manual:
      http://paws.wcu.edu/tsfoguel/tikzpgfmanual.pdf

      • horizontal lines
      • vertical lines
      • north east lines
      • north west lines
      • grid
      • crosshatch
      • dots
      • crosshatch dots
      • fivepointed stars
      • sixpointed stars
      • bricks

      If the fill style is 3002, the pattern=dots is correct. I would suggest it to use also for 3003 instead of the black background. And define an else clause in TTeXDump.cxx:

      PrintStr("@");
      if (fillsi==<=7 || fillsi==10 || fillsi==13)
      {
            PrintStr("\\draw [pattern=");
            if (fillsi==1)  PrintStr("crosshatch dots");
            else if (fillsi==2 || fillsi==3)  PrintStr("dots");
            else if (fillsi==4)  PrintStr("north east lines");
            else if (fillsi==5)  PrintStr("north west lines");
            else if (fillsi==6)  PrintStr("vertical lines");
            else if (fillsi==7)  PrintStr("horizontal lines");
            else if (fillsi==10) PrintStr("bricks");
            else if (fillsi==13) PrintStr("crosshatch");
            PrintStr(", pattern color=c");
      }
      else
      {
            PrintStr("\\draw [fill=c");
      }
       
      if (fCurrentAlpha != 1.) {
       PrintStr(", fill opacity=");
       WriteReal(fCurrentAlpha, kFALSE);
      }

      Attachments

        1. fillstyle.png
          137 kB
          Fernando Hueso González

        Activity

          People

            couet Olivier Couet
            2e7f1fb192878048ddc9 Fernando Hueso González (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Actual End: