@@ -1517,7 +1517,7 @@ export class Linebox extends LineItemLinkedList {
15171517 }
15181518}
15191519
1520- export interface BackgroundBox {
1520+ export interface InlineFragment {
15211521 inline : Inline ;
15221522 start : number ;
15231523 end : number ;
@@ -1529,41 +1529,41 @@ export interface BackgroundBox {
15291529}
15301530
15311531class ContiguousBoxBuilder {
1532- opened : Map < Inline , BackgroundBox > ;
1533- closed : Map < Inline , BackgroundBox [ ] > ;
1532+ opened : Map < Inline , InlineFragment > ;
1533+ closed : Map < Inline , InlineFragment [ ] > ;
15341534
15351535 constructor ( ) {
15361536 this . opened = new Map ( ) ;
15371537 this . closed = new Map ( ) ;
15381538 }
15391539
15401540 open ( inline : Inline , naturalStart : boolean , start : number , blockOffset : number ) {
1541- const box = this . opened . get ( inline ) ;
1541+ const fragment = this . opened . get ( inline ) ;
15421542
1543- if ( box ) {
1544- box . end = start ;
1543+ if ( fragment ) {
1544+ fragment . end = start ;
15451545 } else {
15461546 const end = start ;
15471547 const naturalEnd = false ;
15481548 const { ascender, descender} = inline . metrics ;
1549- const box : BackgroundBox = {
1549+ const fragment : InlineFragment = {
15501550 start, end, inline, blockOffset, ascender, descender, naturalStart, naturalEnd
15511551 } ;
1552- this . opened . set ( inline , box ) ;
1552+ this . opened . set ( inline , fragment ) ;
15531553 // Make sure closed is in open order
15541554 if ( ! this . closed . has ( inline ) ) this . closed . set ( inline , [ ] ) ;
15551555 }
15561556 }
15571557
15581558 close ( inline : Inline , naturalEnd : boolean , end : number ) {
1559- const box = this . opened . get ( inline ) ;
1559+ const fragment = this . opened . get ( inline ) ;
15601560
1561- if ( box ) {
1561+ if ( fragment ) {
15621562 const list = this . closed . get ( inline ) ;
1563- box . end = end ;
1564- box . naturalEnd = naturalEnd ;
1563+ fragment . end = end ;
1564+ fragment . naturalEnd = naturalEnd ;
15651565 this . opened . delete ( inline ) ;
1566- list ? list . push ( box ) : this . closed . set ( inline , [ box ] ) ;
1566+ list ? list . push ( fragment ) : this . closed . set ( inline , [ fragment ] ) ;
15671567 }
15681568 }
15691569
@@ -1651,15 +1651,15 @@ export class Paragraph {
16511651 buffer : AllocatedUint16Array ;
16521652 items : ShapedItem [ ] ;
16531653 lineboxes : Linebox [ ] ;
1654- backgroundBoxes : Map < Inline , BackgroundBox [ ] > ;
1654+ fragments : Map < Inline , InlineFragment [ ] > ;
16551655
16561656 constructor ( ifc : IfcInline , buffer : AllocatedUint16Array ) {
16571657 this . ifc = ifc ;
16581658 this . string = ifc . text ;
16591659 this . buffer = buffer ;
16601660 this . items = [ ] ;
16611661 this . lineboxes = [ ] ;
1662- this . backgroundBoxes = new Map ( ) ;
1662+ this . fragments = new Map ( ) ;
16631663 }
16641664
16651665 getHeight ( ) {
@@ -2653,11 +2653,11 @@ export class Paragraph {
26532653
26542654 if ( boxBuilder ) {
26552655 for ( const [ inline , list ] of boxBuilder . closed ) {
2656- const thisList = this . backgroundBoxes . get ( inline ) ;
2656+ const thisList = this . fragments . get ( inline ) ;
26572657 if ( thisList ) {
2658- for ( const backgroundBox of list ) thisList . push ( backgroundBox ) ;
2658+ for ( const fragment of list ) thisList . push ( fragment ) ;
26592659 } else {
2660- this . backgroundBoxes . set ( inline , list ) ;
2660+ this . fragments . set ( inline , list ) ;
26612661 }
26622662 }
26632663 }
0 commit comments