Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 484d502

Browse files
cprice-scottlogicchrisprice
authored andcommitted
fix: incorrect candlestick/ohlc width
WebGL clip space ranges from -1 to 1 i.e. it is 2 units wide
1 parent 08c2de1 commit 484d502

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/d3fc-webgl/src/series/candlestick.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export default () => {
7575
lineWidth(program);
7676

7777
program.vertexShader().appendBody(`
78-
gl_Position.x += xModifier / uScreen.x;
79-
gl_Position.y += yModifier / uScreen.y;
78+
gl_Position.x += xModifier / uScreen.x * 2.0;
79+
gl_Position.y += yModifier / uScreen.y * 2.0;
8080
`);
8181

8282
decorate(program);

packages/d3fc-webgl/src/series/ohlc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ export default () => {
8787
lineWidth(program);
8888

8989
program.vertexShader().appendBody(`
90-
gl_Position.x += xModifier / uScreen.x;
91-
gl_Position.y += yModifier / uScreen.y;
90+
gl_Position.x += xModifier / uScreen.x * 2.0;
91+
gl_Position.y += yModifier / uScreen.y * 2.0;
9292
`);
9393

9494
decorate(program);

0 commit comments

Comments
 (0)