@@ -132,6 +132,13 @@ function drawedge(ctx, scalefactor, edge, color) {
132132 ctx . moveTo ( ...edge . start ) ;
133133 ctx . lineTo ( ...edge . end ) ;
134134 }
135+ if ( edge . type == "rect" ) {
136+ ctx . moveTo ( ...edge . start ) ;
137+ ctx . lineTo ( edge . start [ 0 ] , edge . end [ 1 ] ) ;
138+ ctx . lineTo ( ...edge . end ) ;
139+ ctx . lineTo ( edge . end [ 0 ] , edge . start [ 1 ] ) ;
140+ ctx . lineTo ( ...edge . start ) ;
141+ }
135142 if ( edge . type == "arc" ) {
136143 ctx . arc (
137144 ...edge . start ,
@@ -363,7 +370,7 @@ function drawModules(canvas, layer, scalefactor, highlight) {
363370function drawBgLayer ( layername , canvas , layer , scalefactor , edgeColor , polygonColor , textColor ) {
364371 var ctx = canvas . getContext ( "2d" ) ;
365372 for ( var d of pcbdata [ layername ] [ layer ] ) {
366- if ( [ "segment" , "arc" , "circle" , "curve" ] . includes ( d . type ) ) {
373+ if ( [ "segment" , "arc" , "circle" , "curve" , "rect" ] . includes ( d . type ) ) {
367374 drawedge ( ctx , scalefactor , d , edgeColor ) ;
368375 } else if ( d . type == "polygon" ) {
369376 drawPolygonShape ( ctx , d , polygonColor ) ;
0 commit comments