Skip to content

Commit 8aecf49

Browse files
committed
Fix precision
1 parent 4a9e721 commit 8aecf49

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

fill-vert.glsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ const float MAX_LINES = 256.;
1414
void main() {
1515
float depth = (MAX_LINES - 4. - id) / (MAX_LINES);
1616

17-
vec2 position = position * scale
18-
+ positionFract * scale
19-
+ position * scaleFract + translate
20-
+ positionFract * scaleFract + translateFract;
17+
vec2 position = position * scale + translate
18+
+ positionFract * scale + translateFract
19+
+ position * scaleFract
20+
+ positionFract * scaleFract;
2121

2222
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
2323

rect-vert.glsl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ varying vec2 tangent;
1414
const float MAX_LINES = 256.;
1515

1616
vec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {
17-
return position * scale
18-
+ positionFract * scale
19-
+ position * scaleFract + translate
20-
+ positionFract * scaleFract + translateFract;
17+
// the order is important
18+
return position * scale + translate
19+
+ positionFract * scale + translateFract
20+
+ position * scaleFract
21+
+ positionFract * scaleFract;
2122
}
2223

2324
void main() {

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ t('closed path', t => {
199199
t.end()
200200
})
201201

202-
t.only('time case', t => {
202+
t('time case', t => {
203203
batch.push({
204204
type: 'rect',
205205
positions: [25741380000,1293840000000,25741380001,1293926400000,25741380002,1294012800000,25741380003,1294099200000,25741380004,1294185600000,1477434180000,1294272000000,1477434180001,1294358400000,1477434180002,1294444800000,1477434180003,1294531200000,1477434180004,1294617600000],

0 commit comments

Comments
 (0)