Rectangle Border Widths

[email protected]
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Is it possible to render rectangles whose vertical lines are different in width from the horizontal lines?  I have tried drawing separate lines for each side adjusting the line width for as needed.  The result is a rectangle but there is a very slight gap where the lines meet.  The gap is more noticeable as the color is made more transparent.  Overlapping the lines works well for opaque colors but not for transparent.  This is what I am currently doing . . . 



      cairo_new_sub_path (m_pCairo);
      cairo_move_to (m_pCairo, m_dXPos+l_dBorderWidthV, m_dYPos+l_dBorderOffsetH);
      cairo_line_to (m_pCairo, m_dXPos+m_dWidth-l_dBorderWidthV, m_dYPos+l_dBorderOffsetH);
      cairo_move_to (m_pCairo, m_dXPos+l_dBorderWidthV, m_dYPos+m_dHeight-l_dBorderOffsetH);
      cairo_line_to (m_pCairo, m_dXPos+m_dWidth-l_dBorderWidthV, m_dYPos+m_dHeight-l_dBorderOffsetH);
      cairo_set_line_width (m_pCairo, l_dBorderWidthH);
      cairo_stroke(m_pCairo);
      cairo_set_line_width (m_pCairo, l_dBorderWidthV);
      cairo_move_to (m_pCairo, m_dXPos+l_dBorderOffsetV, m_dYPos);
      cairo_line_to (m_pCairo, m_dXPos+l_dBorderOffsetV, m_dYPos+m_dHeight);
      cairo_move_to (m_pCairo, m_dXPos+m_dWidth-l_dBorderOffsetV, m_dYPos);
      cairo_line_to (m_pCairo, m_dXPos+m_dWidth-l_dBorderOffsetV, m_dYPos+m_dHeight);
      cairo_close_path (m_pCairo);
      cairo_set_line_width (m_pCairo, l_dBorderWidthH);
      cairo_stroke(m_pCairo);



Thanks,
Bob

--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.