Skip to content

Commit

Permalink
improved(display): The anti-aliasing for lines using floating point w…
Browse files Browse the repository at this point in the history
…idths has been enhanced.

Signed-off-by: Tim Deubler <[email protected]>
  • Loading branch information
TerminalTim committed Nov 21, 2023
1 parent 1a26995 commit 35b891a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ export class FeatureFactory {
} else if (type == 'Line') {
if (!stroke || !strokeWidth) continue;

const [value, unit] = parseSizeValue(strokeWidth);
const [value, unit] = parseSizeValue(strokeWidth, false);
strokeWidth = value;
sizeUnit = unit;

Expand Down
2 changes: 1 addition & 1 deletion packages/display/src/displays/webgl/glsl/line_vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void main(void){
: strokeWidth < 1. ? .65 : 1.;

float width = (strokeWidth+alias) / u_scale;
v_width = vec2(strokeWidth, alias * .5);
v_width = vec2(strokeWidth, alias /* *.5 */);
// LSB is direction/normal vector [-1,+1]
vec2 dir2 = mod(a_normal.zw, 2.0) * 2.0 - 1.0;
vec2 aliasNormal = floor(a_normal.zw * .5) * N_SCALE;
Expand Down

0 comments on commit 35b891a

Please sign in to comment.