Edge disregarding shape-rendering attribute on SVG
I am currently developing a web-based application which uses SVG graphics. However, I was shocked to discover that MS Edge does not render the images correctly. Edge seems to ignore the attribute shape-rendering, which is set to crispEdges in order to disable anti-aliasing.
The code snippet below works fine in Chrome, but Edge decides to render it with anti-aliasing and the middle line is thus not perfectly red. With crispEdges the two middle lines are exactly overlapping.
I couldn't find anything on Google as to why this might be the case. Does anybody have an idea why this behaviour occurs and how to fix it?
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="80" shape-rendering="crispEdges" stroke-linecap="square" stroke-width="1">
<line x1="0.5" y1="71.5" x2="71.5" y2="0.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(255,0,0)"/>
<line x1="142.5" y1="71.5" x2="213.5" y2="0.5" stroke="rgb(255,0,0)"/>
</svg>svg microsoft-edge shape-rendering
add a comment |
I am currently developing a web-based application which uses SVG graphics. However, I was shocked to discover that MS Edge does not render the images correctly. Edge seems to ignore the attribute shape-rendering, which is set to crispEdges in order to disable anti-aliasing.
The code snippet below works fine in Chrome, but Edge decides to render it with anti-aliasing and the middle line is thus not perfectly red. With crispEdges the two middle lines are exactly overlapping.
I couldn't find anything on Google as to why this might be the case. Does anybody have an idea why this behaviour occurs and how to fix it?
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="80" shape-rendering="crispEdges" stroke-linecap="square" stroke-width="1">
<line x1="0.5" y1="71.5" x2="71.5" y2="0.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(255,0,0)"/>
<line x1="142.5" y1="71.5" x2="213.5" y2="0.5" stroke="rgb(255,0,0)"/>
</svg>svg microsoft-edge shape-rendering
1
shape-renderingis a rendering hint, not a fixed algorithm, and results are not guaranteed. Look at the spec, implementers have some wiggling room for what they should do: "To achieve crisp edges, the user agent might turn off anti-aliasing...possibly just for straight lines which are close to vertical or horizontal."
– ccprog
Nov 19 '18 at 0:31
Is there a way to enforce the disabling of anti-alisaing?
– J. Doe
Nov 19 '18 at 15:08
Well, for reference APNG is 10 years old and Edge still doesn't support it. Just advise your users to move to a browser that is relevant and functional.
– Havenard
Nov 28 '18 at 17:34
add a comment |
I am currently developing a web-based application which uses SVG graphics. However, I was shocked to discover that MS Edge does not render the images correctly. Edge seems to ignore the attribute shape-rendering, which is set to crispEdges in order to disable anti-aliasing.
The code snippet below works fine in Chrome, but Edge decides to render it with anti-aliasing and the middle line is thus not perfectly red. With crispEdges the two middle lines are exactly overlapping.
I couldn't find anything on Google as to why this might be the case. Does anybody have an idea why this behaviour occurs and how to fix it?
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="80" shape-rendering="crispEdges" stroke-linecap="square" stroke-width="1">
<line x1="0.5" y1="71.5" x2="71.5" y2="0.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(255,0,0)"/>
<line x1="142.5" y1="71.5" x2="213.5" y2="0.5" stroke="rgb(255,0,0)"/>
</svg>svg microsoft-edge shape-rendering
I am currently developing a web-based application which uses SVG graphics. However, I was shocked to discover that MS Edge does not render the images correctly. Edge seems to ignore the attribute shape-rendering, which is set to crispEdges in order to disable anti-aliasing.
The code snippet below works fine in Chrome, but Edge decides to render it with anti-aliasing and the middle line is thus not perfectly red. With crispEdges the two middle lines are exactly overlapping.
I couldn't find anything on Google as to why this might be the case. Does anybody have an idea why this behaviour occurs and how to fix it?
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="80" shape-rendering="crispEdges" stroke-linecap="square" stroke-width="1">
<line x1="0.5" y1="71.5" x2="71.5" y2="0.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(255,0,0)"/>
<line x1="142.5" y1="71.5" x2="213.5" y2="0.5" stroke="rgb(255,0,0)"/>
</svg><svg xmlns="http://www.w3.org/2000/svg" width="300" height="80" shape-rendering="crispEdges" stroke-linecap="square" stroke-width="1">
<line x1="0.5" y1="71.5" x2="71.5" y2="0.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(255,0,0)"/>
<line x1="142.5" y1="71.5" x2="213.5" y2="0.5" stroke="rgb(255,0,0)"/>
</svg><svg xmlns="http://www.w3.org/2000/svg" width="300" height="80" shape-rendering="crispEdges" stroke-linecap="square" stroke-width="1">
<line x1="0.5" y1="71.5" x2="71.5" y2="0.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(0,0,255)"/>
<line x1="71.5" y1="0.5" x2="142.5" y2="71.5" stroke="rgb(255,0,0)"/>
<line x1="142.5" y1="71.5" x2="213.5" y2="0.5" stroke="rgb(255,0,0)"/>
</svg>svg microsoft-edge shape-rendering
svg microsoft-edge shape-rendering
edited Nov 28 '18 at 17:29
TylerH
15.4k105067
15.4k105067
asked Nov 18 '18 at 23:54
J. DoeJ. Doe
83
83
1
shape-renderingis a rendering hint, not a fixed algorithm, and results are not guaranteed. Look at the spec, implementers have some wiggling room for what they should do: "To achieve crisp edges, the user agent might turn off anti-aliasing...possibly just for straight lines which are close to vertical or horizontal."
– ccprog
Nov 19 '18 at 0:31
Is there a way to enforce the disabling of anti-alisaing?
– J. Doe
Nov 19 '18 at 15:08
Well, for reference APNG is 10 years old and Edge still doesn't support it. Just advise your users to move to a browser that is relevant and functional.
– Havenard
Nov 28 '18 at 17:34
add a comment |
1
shape-renderingis a rendering hint, not a fixed algorithm, and results are not guaranteed. Look at the spec, implementers have some wiggling room for what they should do: "To achieve crisp edges, the user agent might turn off anti-aliasing...possibly just for straight lines which are close to vertical or horizontal."
– ccprog
Nov 19 '18 at 0:31
Is there a way to enforce the disabling of anti-alisaing?
– J. Doe
Nov 19 '18 at 15:08
Well, for reference APNG is 10 years old and Edge still doesn't support it. Just advise your users to move to a browser that is relevant and functional.
– Havenard
Nov 28 '18 at 17:34
1
1
shape-rendering is a rendering hint, not a fixed algorithm, and results are not guaranteed. Look at the spec, implementers have some wiggling room for what they should do: "To achieve crisp edges, the user agent might turn off anti-aliasing...possibly just for straight lines which are close to vertical or horizontal."– ccprog
Nov 19 '18 at 0:31
shape-rendering is a rendering hint, not a fixed algorithm, and results are not guaranteed. Look at the spec, implementers have some wiggling room for what they should do: "To achieve crisp edges, the user agent might turn off anti-aliasing...possibly just for straight lines which are close to vertical or horizontal."– ccprog
Nov 19 '18 at 0:31
Is there a way to enforce the disabling of anti-alisaing?
– J. Doe
Nov 19 '18 at 15:08
Is there a way to enforce the disabling of anti-alisaing?
– J. Doe
Nov 19 '18 at 15:08
Well, for reference APNG is 10 years old and Edge still doesn't support it. Just advise your users to move to a browser that is relevant and functional.
– Havenard
Nov 28 '18 at 17:34
Well, for reference APNG is 10 years old and Edge still doesn't support it. Just advise your users to move to a browser that is relevant and functional.
– Havenard
Nov 28 '18 at 17:34
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53366658%2fedge-disregarding-shape-rendering-attribute-on-svg%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53366658%2fedge-disregarding-shape-rendering-attribute-on-svg%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
shape-renderingis a rendering hint, not a fixed algorithm, and results are not guaranteed. Look at the spec, implementers have some wiggling room for what they should do: "To achieve crisp edges, the user agent might turn off anti-aliasing...possibly just for straight lines which are close to vertical or horizontal."– ccprog
Nov 19 '18 at 0:31
Is there a way to enforce the disabling of anti-alisaing?
– J. Doe
Nov 19 '18 at 15:08
Well, for reference APNG is 10 years old and Edge still doesn't support it. Just advise your users to move to a browser that is relevant and functional.
– Havenard
Nov 28 '18 at 17:34