@@ -250,11 +250,19 @@ CommonWrapper<
250250 const f = SVGWrapper . borderFuzz ;
251251 const bbox = this . getOuterBBox ( ) ;
252252 const [ h , d , w ] = [ bbox . h + f , bbox . d + f , bbox . w + f ] ;
253- const paths : [ number , number ] [ ] [ ] = [
254- [ [ - f , h ] , [ w , h ] , [ w - width [ 1 ] , h - width [ 0 ] ] , [ - f + width [ 3 ] , h - width [ 0 ] ] ] ,
255- [ [ w , - d ] , [ w , h ] , [ w - width [ 1 ] , h - width [ 0 ] ] , [ w - width [ 1 ] , - d + width [ 2 ] ] ] ,
256- [ [ - f , - d ] , [ w , - d ] , [ w - width [ 1 ] , - d + width [ 2 ] ] , [ - f + width [ 3 ] , - d + width [ 2 ] ] ] ,
257- [ [ - f , - d ] , [ - f , h ] , [ - f + width [ 3 ] , h - width [ 0 ] ] , [ - f + width [ 3 ] , - d + width [ 2 ] ] ]
253+ const outerRT = [ w , h ] ;
254+ const outerLT = [ - f , h ] ;
255+ const outerRB = [ w , - d ] ;
256+ const outerLB = [ - f , - d ] ;
257+ const innerRT = [ w - width [ 1 ] , h - width [ 0 ] ] ;
258+ const innerLT = [ - f + width [ 3 ] , h - width [ 0 ] ] ;
259+ const innerRB = [ w - width [ 1 ] , - d + width [ 2 ] ] ;
260+ const innerLB = [ - f + width [ 3 ] , - d + width [ 2 ] ] ;
261+ const paths : number [ ] [ ] [ ] = [
262+ [ outerLT , outerRT , innerRT , innerLT ] ,
263+ [ outerRB , outerRT , innerRT , innerRB ] ,
264+ [ outerLB , outerRB , innerRB , innerLB ] ,
265+ [ outerLB , outerLT , innerLT , innerLB ]
258266 ] ;
259267 const adaptor = this . adaptor ;
260268 const child = adaptor . firstChild ( this . element ) as N ;
@@ -276,7 +284,7 @@ CommonWrapper<
276284 * @param {string } color The color to use
277285 * @param {N } child Insert the border before this child, if any
278286 */
279- protected addBorderSolid ( path : [ number , number ] [ ] , color : string , child : N ) {
287+ protected addBorderSolid ( path : number [ ] [ ] , color : string , child : N ) {
280288 const border = this . svg ( 'polygon' , {
281289 points : path . map ( ( [ x , y ] ) => `${ this . fixed ( x - this . dx ) } ,${ this . fixed ( y ) } ` ) . join ( ' ' ) ,
282290 stroke : 'none' ,
@@ -298,7 +306,7 @@ CommonWrapper<
298306 * @param {number } t The thickness for the border line
299307 * @param {number } i The side being drawn
300308 */
301- protected addBorderBroken ( path : [ number , number ] [ ] , color : string , style : string , t : number , i : number ) {
309+ protected addBorderBroken ( path : number [ ] [ ] , color : string , style : string , t : number , i : number ) {
302310 const dot = ( style === 'dotted' ) ;
303311 const t2 = t / 2 ;
304312 const [ tx1 , ty1 , tx2 , ty2 ] = [ [ t2 , - t2 , - t2 , - t2 ] , [ - t2 , t2 , - t2 , - t2 ] , [ t2 , t2 , - t2 , t2 ] , [ t2 , t2 , t2 , - t2 ] ] [ i ] ;
0 commit comments