채우기 및 획을 적용한 순서에 따라 결과가 달라집니다. HTML 캔버스를 사용하면 순서를 제어 할 수 있습니다. 여기 SVG에서 채우기 및 획의 순서를 제어하는 방법은 무엇입니까?
채우기 스트로크 전에 적용될 때 결과 : http://jsfiddle.net/YLk2F/ctx.fillStyle = options.fillColor;
ctx.fillText(options.text, options.x, options.y);
ctx.strokeStyle = options.outlineColor;
ctx.lineWidth = options.outlineWidth;
ctx.strokeText(options.text, options.x, options.y);
채운다 뇌졸중 이후에인가 될 때 : http://jsfiddle.net/jsMX9/
ctx.strokeStyle = options.outlineColor;
ctx.lineWidth = options.outlineWidth;
ctx.strokeText(options.text, options.x, options.y);
ctx.fillStyle = options.fillColor;
ctx.fillText(options.text, options.x, options.y);
,536,913,632 10
SVG에서는 모든 것이 SVG 속성을 통해 이루어지며 획보다 먼저 채우기가 적용된 것처럼 보입니다. 참조 예컨대 : http://jsfiddle.net/wYw86/1
<svg id="SvgjsSvg1000" xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
<text id="SvgjsText1006" font-family="times new roman" font-size="40pt" stroke="#ff0000" stroke-width="2" fill="#000000" transform="translate(100 100)">
<tspan id="SvgjsTspan1008" style="font-weight: bold; font-style: italic; font-variant: small-caps; text-decoration: underline;">Hello World!</tspan>
</text>
</svg>
하면 해당 채우기가 SVG에서 뇌졸중 후 적용되도록이 순서를 반대로 할 수 있습니까? 방법?
스트로크는 SVG를 채운 후에 항상 적용됩니다. SVG 단위를 정의하지 않았고 브라우저가 의도를 정확하게 추측하지 않아서보고있는 효과가있을 수 있습니다. –
감사합니다. 당신이 옳았. 내 코드에 버그가있었습니다 (캔버스 예제에서는 2 픽셀 너비, svg에서는 1 픽셀 너비 사용). 올바른 코드와 이미지로 질문을 업데이트했습니다. – morpheus
SVG를 채운 후에 획이 항상 적용된다는 주장을 뒷받침하는 참조가 있습니까? 그건 분명히 그런 식으로 보이지만, SVG의 기술 사양에서 이것을 찾을 수 없습니다. – morpheus