This commit is contained in:
parent
6bc125be1c
commit
ed5a4379db
76 changed files with 1418 additions and 988 deletions
|
|
@ -33,10 +33,12 @@ fn vertex(
|
|||
let direction = end - start;
|
||||
let denominator = dot(direction, direction);
|
||||
var inverseLengthSquared = 0.0;
|
||||
var normalizedDirection = vec2<f32>(1.0, 0.0);
|
||||
if denominator > settings.lineDistanceEpsilon {
|
||||
inverseLengthSquared = 1.0 / denominator;
|
||||
normalizedDirection = direction * inverseSqrt(denominator);
|
||||
}
|
||||
let screenPosition = segment_vertex_position(vertexIndex, start, end, settings.eraserRadius);
|
||||
let screenPosition = segment_vertex_position(vertexIndex, start, end, normalizedDirection, settings.eraserRadius);
|
||||
let uv = screenPosition / state.size;
|
||||
let position = vec2(uv.x * 2.0 - 1.0, 1.0 - uv.y * 2.0);
|
||||
return VertexOutput(vec4(position, 0.0, 1.0), screenPosition, start, direction, inverseLengthSquared);
|
||||
|
|
|
|||
Loading…
Reference in a new issue