Sub-issue of #50.
Problem
The renderer needs to correctly dispatch between \draw and \filldraw
based on whether rgbFace is provided, and honour the GraphicsContext
stroke color, line width, and dash pattern. Emitted colors must also be
declared via \definecolor in the preamble so the output snippet is
self-contained and portable.
Proposed fix
def _cmd(self, gc, rgbFace):
stroke = _rgb_to_tikz(gc.get_rgb())
lw = gc.get_linewidth()
if rgbFace is None:
return rf'\draw[color={stroke}, line width={lw:.2f}pt]'
fill = _rgb_to_tikz(rgbFace)
return rf'\filldraw[color={stroke}, fill={fill}, line width={lw:.2f}pt]'
Maintain a color registry on the renderer; emit every unique color as a
\definecolor{name}{rgb}{r,g,b} line in the output preamble.
Acceptance criteria
Sub-issue of #50.
Problem
The renderer needs to correctly dispatch between
\drawand\filldrawbased on whether
rgbFaceis provided, and honour theGraphicsContextstroke color, line width, and dash pattern. Emitted colors must also be
declared via
\definecolorin the preamble so the output snippet isself-contained and portable.
Proposed fix
Maintain a color registry on the renderer; emit every unique color as a
\definecolor{name}{rgb}{r,g,b}line in the output preamble.Acceptance criteria
\draw[...]with correct stroke color and line width.\filldraw[...]with bothcolor=(stroke) andfill=set.\definecoloronce in the preamble.gc.get_dashes()are translated to TikZdashed/dotted/ customdash pattern=...as appropriate.