D
D
dom1n1k2011-09-26 21:32:23
Canvas
dom1n1k, 2011-09-26 21:32:23

Canvas: self-overlay translucent lines?

The lines in the picture below are drawn with translucent colors (alpha=0.5).
It can be seen that when the red outline intersects itself, there is no double overlay of the translucent color (as it would be logical to expect). At the same time, the green line at the intersections is superimposed on the red one, as it should be.
It turns out that the lines on the canvas are filled entirely, like areas. It may even be convenient in some situations, but personally I think that this is the wrong behavior.
Live demo: jsfiddle.net/dom1n1k/xb2AY/
canvas-line-alpha.png
I won't ask how to fix it :) The
question will be ideological: how do you personally evaluate this behavior?
1. This is logical and generally the way it should be;
2. This is not entirely logical, but if it has already happened, it can be considered a feature;
3. This is a clear bug, and in a good way, browser authors should fix this.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
tick, 2011-09-26
@tick

I consider this a feature.

Z
ZimM, 2011-09-27
@ZimM

This behavior is correct, in my opinion. Where have you ever seen translucent lines drawn like this? Direct3D and OpenGL draw exactly the same way, eg.
After all, there are ways around this, so I personally don't see it as a problem.

A
Andrew, 2011-09-27
@Morfi

Divide into different objects

A
Andrew, 2011-09-27
@Morfi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question