Вопрос по svg – Как сделать ширину штриха невосприимчивой к текущей матрице преобразования

35

Error: User Rate Limit Exceeded

  <g transform="rotate(30) scale(5,1) ">
      <rect x="10" y="10" width="20" height="20" 
            stroke="blue" fill="none" stroke-width="2"/>
  </g>

rectangle width scaled pen

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededrectError: User Rate Limit ExceededpathError: User Rate Limit Exceeded

Error: User Rate Limit Exceededstackoverflow.com/questions/10160262/… Erik Dahlström

Ваш Ответ

2   ответа
43

Edit:

Error: User Rate Limit Exceeded

vector-effect="non-scaling-stroke"

This was wrong:

Error: User Rate Limit Exceeded

<rect x="10" y="10" width="20" height="20" 
            stroke="blue" fill="none" stroke-width="2"
            transform="rotate(30) scale(5,1)"/>

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded xan
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededvector-effect:non-scaling-stroke
Error: User Rate Limit Exceededhere.
Error: User Rate Limit Exceeded xan
6

%!PS
%A Funky Shape

matrix currentmatrix %save normal matrix for stroke pen
306 396 translate
72 72 scale
1 1 5 { pop
    360 5 div rotate
    1 0 translate
    0 0 moveto
    1 1 5 { pop
        360 5 div rotate
        1 0 translate
        1 0 lineto
        -1 0 translate
    } for
    -1 0 translate
    closepath
} for
setmatrix
[ 1 -3 4 2 0 0 ] concat %put some skew in the pen
10 rotate     %makes it look more "organic"
stroke
showpage

Похожие вопросы