@@ -179,11 +179,17 @@ const enum Style {
179179 BOLD = 3
180180}
181181
182+ /**
183+ * @param xp The percentage of 15% of the x axis.
184+ * @param yp The percentage of 15% of the x axis on the y axis.
185+ */
186+ type DrawFunctionDefinition = ( xp : number , yp : number ) => string ;
187+
182188/**
183189 * This contains the definitions of all box drawing characters in the format of SVG paths (ie. the
184190 * svg d attribute).
185191 */
186- export const boxDrawingDefinitions : { [ character : string ] : { [ fontWeight : number ] : string | ( ( xp : number , yp : number ) => string ) } | undefined } = {
192+ export const boxDrawingDefinitions : { [ character : string ] : { [ fontWeight : number ] : string | DrawFunctionDefinition } | undefined } = {
187193 // Uniform normal and bold
188194 '─' : { [ Style . NORMAL ] : Shapes . LEFT_TO_RIGHT } ,
189195 '━' : { [ Style . BOLD ] : Shapes . LEFT_TO_RIGHT } ,
@@ -319,10 +325,10 @@ export const boxDrawingDefinitions: { [character: string]: { [fontWeight: number
319325 '┋' : { [ Style . BOLD ] : Shapes . FOUR_DASHES_VERTICAL } ,
320326
321327 // Curved
322- '╭' : { [ Style . NORMAL ] : 'C .5,1,.5,.5, 1,.5' } ,
323- '╮' : { [ Style . NORMAL ] : 'C .5,1,.5,.5, 0,.5' } ,
324- '╯' : { [ Style . NORMAL ] : 'C .5,0,.5,.5, 0,.5' } ,
325- '╰' : { [ Style . NORMAL ] : 'C .5,0,.5,.5, 1,.5' }
328+ '╭' : { [ Style . NORMAL ] : ( xp , yp ) => `M .5,1 L.5, ${ .5 + ( yp / .15 * .5 ) } C.5, ${ .5 + ( yp / .15 * .5 ) } ,.5,.5, 1,.5` } ,
329+ '╮' : { [ Style . NORMAL ] : ( xp , yp ) => `M .5,1 L.5, ${ .5 + ( yp / .15 * .5 ) } C.5, ${ .5 + ( yp / .15 * .5 ) } ,.5,.5, 0,.5` } ,
330+ '╯' : { [ Style . NORMAL ] : ( xp , yp ) => `M .5,0 L.5, ${ .5 - ( yp / .15 * .5 ) } C.5, ${ .5 - ( yp / .15 * .5 ) } ,.5,.5, 0,.5` } ,
331+ '╰' : { [ Style . NORMAL ] : ( xp , yp ) => `M .5,0 L.5, ${ .5 - ( yp / .15 * .5 ) } C.5, ${ .5 - ( yp / .15 * .5 ) } ,.5,.5, 1,.5` }
326332} ;
327333
328334interface IVectorShape {
0 commit comments