File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ class BrailleToGeometry
91
91
let geom = [ ] ;
92
92
93
93
const sort_predicate_y = ( a , b ) => {
94
- if ( a . y === b . y ) return ( a . x - b . x ) ;
94
+ if ( a . y === b . y )
95
+ return ( ( a . x - b . x ) * dir ) ;
95
96
return ( a . y - b . y ) ;
96
97
}
97
98
if ( inputgeom == null )
@@ -105,6 +106,7 @@ class BrailleToGeometry
105
106
e = 0 ;
106
107
while ( e < geom . length )
107
108
{
109
+ // get the last dot with same y position
108
110
while ( ( geom [ s ] . y === geom [ e ] . y ) )
109
111
{
110
112
e ++ ;
@@ -115,6 +117,8 @@ class BrailleToGeometry
115
117
}
116
118
117
119
//if (e - s >= 0)
120
+ // all dots on same position are a single line
121
+ // sort this lines in zigzag order (one from right to left, the next from left to right ...)
118
122
{
119
123
for ( i = s ; i < e ; i ++ )
120
124
{
You can’t perform that action at this time.
0 commit comments