File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,13 @@ function getStoredCheckboxRefs(checkbox) {
104
104
}
105
105
}
106
106
if ( ! ( checkbox in settings . checkboxStoredRefs ) ) {
107
- settings . checkboxStoredRefs [ checkbox ] = readStorage ( "checkbox_" + checkbox ) ;
107
+ var val = readStorage ( "checkbox_" + checkbox ) ;
108
+ settings . checkboxStoredRefs [ checkbox ] = val ? val : "" ;
108
109
}
109
110
if ( ! settings . checkboxStoredRefs [ checkbox ] ) {
110
111
return new Set ( ) ;
111
112
} else {
112
- return new Set ( settings . checkboxStoredRefs [ checkbox ] . split ( "," ) . map ( r => convert ( r ) ) ) ;
113
+ return new Set ( settings . checkboxStoredRefs [ checkbox ] . split ( "," ) . map ( r => convert ( r ) ) . filter ( a => a >= 0 ) ) ;
113
114
}
114
115
}
115
116
Original file line number Diff line number Diff line change @@ -177,16 +177,15 @@ function getPolygonsPath(shape) {
177
177
if ( shape . svgpath ) {
178
178
shape . path2d = new Path2D ( shape . svgpath ) ;
179
179
} else {
180
- var combinedPath = new Path2D ( ) ;
180
+ var path = new Path2D ( ) ;
181
181
for ( var polygon of shape . polygons ) {
182
- var path = new Path2D ( ) ;
183
- for ( var vertex of polygon ) {
184
- path . lineTo ( ...vertex )
182
+ path . moveTo ( ... polygon [ 0 ] ) ;
183
+ for ( var i = 1 ; i < polygon . length ; i ++ ) {
184
+ path . lineTo ( ...polygon [ i ] ) ;
185
185
}
186
186
path . closePath ( ) ;
187
- combinedPath . addPath ( path ) ;
188
187
}
189
- shape . path2d = combinedPath ;
188
+ shape . path2d = path ;
190
189
}
191
190
return shape . path2d ;
192
191
}
You can’t perform that action at this time.
0 commit comments