File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 155155 const charWidth = 8 ;
156156 const leftMargin = 20 ;
157157 const topMargin = 10 ;
158- const indentWidth = 24 ;
158+ const indentWidth = 40 ; // Increased from 24 for wider indent
159159 const boxPadding = 8 ;
160160 const maxBoxWidth = 280 ; // Max width for text in box
161161 const maxCharsPerLine = Math . floor ( maxBoxWidth / charWidth ) ;
294294 line . setAttribute ( 'stroke-width' , '1' ) ;
295295 svg . appendChild ( line ) ;
296296
297- // Horizontal line to child
297+ // Horizontal line to child (extended to match wider indent)
298298 const boxX = x + 10 ;
299+ const hlineExtension = 15 ; // Extra space for label
299300 const hline = document . createElementNS ( 'http://www.w3.org/2000/svg' , 'line' ) ;
300301 hline . setAttribute ( 'x1' , connectorX ) ;
301302 hline . setAttribute ( 'y1' , y ) ;
302- hline . setAttribute ( 'x2' , boxX ) ;
303+ hline . setAttribute ( 'x2' , boxX + hlineExtension ) ;
303304 hline . setAttribute ( 'y2' , y ) ;
304305 hline . setAttribute ( 'stroke' , '#999' ) ;
305306 hline . setAttribute ( 'stroke-width' , '1' ) ;
306307 svg . appendChild ( hline ) ;
307308
308309 // Add answer label on the horizontal line, positioned below it to avoid boxes
309- const labelX = connectorX + ( boxX - connectorX ) / 2 ;
310+ const labelX = connectorX + ( boxX + hlineExtension - connectorX ) / 2 ;
310311 const labelY = y + 10 ;
311312
312313 const label = document . createElementNS ( 'http://www.w3.org/2000/svg' , 'text' ) ;
You can’t perform that action at this time.
0 commit comments