@@ -33,9 +33,9 @@ export class EntryLinkStartCreating extends Event {
3333export class EntriesLinkOverlay extends HTMLElement {
3434 readonly #shadow = this . attachShadow ( { mode : 'open' } ) ;
3535 #coordinateFrom: { x : number , y : number } ;
36- #fromEntryDimentions : { width : number , height : number } ;
36+ #fromEntryDimensions : { width : number , height : number } ;
3737 #coordinateTo: { x : number , y : number } ;
38- #toEntryDimentions : { width : number , height : number } | null = null ;
38+ #toEntryDimensions : { width : number , height : number } | null = null ;
3939 #connectorLineContainer: SVGAElement | null = null ;
4040 #connector: SVGLineElement | null = null ;
4141 #entryFromWrapper: HTMLElement | null = null ;
@@ -56,16 +56,16 @@ export class EntriesLinkOverlay extends HTMLElement {
5656 #linkState: Trace . Types . File . EntriesLinkState ;
5757
5858 constructor (
59- initialFromEntryCoordinateAndDimentions : { x : number , y : number , width : number , height : number } ,
59+ initialFromEntryCoordinateAndDimensions : { x : number , y : number , width : number , height : number } ,
6060 linkCreationNotStartedState : Trace . Types . File . EntriesLinkState ) {
6161 super ( ) ;
6262 this . #render( ) ;
63- this . #coordinateFrom = { x : initialFromEntryCoordinateAndDimentions . x , y : initialFromEntryCoordinateAndDimentions . y } ;
64- this . #fromEntryDimentions = {
65- width : initialFromEntryCoordinateAndDimentions . width ,
66- height : initialFromEntryCoordinateAndDimentions . height ,
63+ this . #coordinateFrom = { x : initialFromEntryCoordinateAndDimensions . x , y : initialFromEntryCoordinateAndDimensions . y } ;
64+ this . #fromEntryDimensions = {
65+ width : initialFromEntryCoordinateAndDimensions . width ,
66+ height : initialFromEntryCoordinateAndDimensions . height ,
6767 } ;
68- this . #coordinateTo = { x : initialFromEntryCoordinateAndDimentions . x , y : initialFromEntryCoordinateAndDimentions . y } ;
68+ this . #coordinateTo = { x : initialFromEntryCoordinateAndDimensions . x , y : initialFromEntryCoordinateAndDimensions . y } ;
6969 this . #connectorLineContainer = this . #shadow. querySelector < SVGAElement > ( '.connectorContainer' ) ?? null ;
7070 this . #connector = this . #connectorLineContainer?. querySelector ( 'line' ) ?? null ;
7171 this . #entryFromWrapper = this . #shadow. querySelector ( '.from-highlight-wrapper' ) ?? null ;
@@ -110,9 +110,9 @@ export class EntriesLinkOverlay extends HTMLElement {
110110 }
111111 }
112112
113- set fromEntryCoordinateAndDimentions ( fromEntryParams : { x : number , y : number , length : number , height : number } ) {
113+ set fromEntryCoordinateAndDimensions ( fromEntryParams : { x : number , y : number , length : number , height : number } ) {
114114 this . #coordinateFrom = { x : fromEntryParams . x , y : fromEntryParams . y } ;
115- this . #fromEntryDimentions = { width : fromEntryParams . length , height : fromEntryParams . height } ;
115+ this . #fromEntryDimensions = { width : fromEntryParams . length , height : fromEntryParams . height } ;
116116 this . #updateCreateLinkBox( ) ;
117117 this . #redrawConnectionArrow( ) ;
118118 }
@@ -125,12 +125,12 @@ export class EntriesLinkOverlay extends HTMLElement {
125125
126126 // The arrow might be pointing either to an entry or an empty space.
127127 // If the dimensions are not passed, it is pointing at an empty space.
128- set toEntryCoordinateAndDimentions ( toEntryParams : { x : number , y : number , length ?: number , height ?: number } ) {
128+ set toEntryCoordinateAndDimensions ( toEntryParams : { x : number , y : number , length ?: number , height ?: number } ) {
129129 this . #coordinateTo = { x : toEntryParams . x , y : toEntryParams . y } ;
130130 if ( toEntryParams . length && toEntryParams . height ) {
131- this . #toEntryDimentions = { width : toEntryParams . length , height : toEntryParams . height } ;
131+ this . #toEntryDimensions = { width : toEntryParams . length , height : toEntryParams . height } ;
132132 } else {
133- this . #toEntryDimentions = null ;
133+ this . #toEntryDimensions = null ;
134134 }
135135
136136 this . #updateCreateLinkBox( ) ;
@@ -177,9 +177,9 @@ export class EntriesLinkOverlay extends HTMLElement {
177177 // we aren't drawing the arrows, so it doesn't make sense to draw the
178178 // connectors.
179179 const drawFromEntryConnectorCircle = this . #entryFromVisible && ! this . #arrowHidden && this . #fromEntryIsSource &&
180- this . #fromEntryDimentions . width >= minWidthToDrawConnectorCircles ;
180+ this . #fromEntryDimensions . width >= minWidthToDrawConnectorCircles ;
181181
182- const widthOfToEntry = this . #toEntryDimentions ?. width ?? 0 ;
182+ const widthOfToEntry = this . #toEntryDimensions ?. width ?? 0 ;
183183 const drawToEntryConnectorCircle = ! this . #arrowHidden && this . #entryToVisible && this . #toEntryIsSource &&
184184 widthOfToEntry >= minWidthToDrawConnectorCircles && ! this . #arrowHidden;
185185
@@ -188,9 +188,9 @@ export class EntriesLinkOverlay extends HTMLElement {
188188
189189 // If the entry is visible, the entry arrow starts from the middle of the right edge of the entry (end on the X axis and middle of the Y axis).
190190 // If not, draw it to the y coordinate of the entry and the edge of the timeline so it is pointing in the direction of the entry.
191- const halfFromEntryHeight = this . #fromEntryDimentions . height / 2 ;
191+ const halfFromEntryHeight = this . #fromEntryDimensions . height / 2 ;
192192 if ( this . #entryFromVisible) {
193- const endConnectionPointX = String ( this . #coordinateFrom. x + this . #fromEntryDimentions . width ) ;
193+ const endConnectionPointX = String ( this . #coordinateFrom. x + this . #fromEntryDimensions . width ) ;
194194 const endConnectionPointY = String ( this . #coordinateFrom. y + halfFromEntryHeight ) ;
195195
196196 this . #connector. setAttribute ( 'x1' , endConnectionPointX ) ;
@@ -200,17 +200,17 @@ export class EntriesLinkOverlay extends HTMLElement {
200200 this . #entryFromConnector. setAttribute ( 'cy' , endConnectionPointY ) ;
201201 this . #entryFromWrapper. style . visibility = 'visible' ;
202202 } else {
203- this . #connector. setAttribute ( 'x1' , ( this . #coordinateFrom. x + this . #fromEntryDimentions . width ) . toString ( ) ) ;
203+ this . #connector. setAttribute ( 'x1' , ( this . #coordinateFrom. x + this . #fromEntryDimensions . width ) . toString ( ) ) ;
204204 this . #connector. setAttribute ( 'y1' , String ( this . #coordinateFrom. y + halfFromEntryHeight ) ) ;
205205 this . #entryFromWrapper. style . visibility = 'hidden' ;
206206 }
207207
208208 // If the arrow is pointing to the entry and that entry is visible, point it to the middle of the entry.
209209 // If the entry is not visible, point the arrow to the edge of the screen towards the entry.
210210 // Otherwise, the arrow is following the mouse so we assign it to the provided coordinates.
211- if ( this . #toEntryDimentions && this . #entryToVisible) {
211+ if ( this . #toEntryDimensions && this . #entryToVisible) {
212212 const connectionPointX = String ( this . #coordinateTo. x ) ;
213- const connectionPointY = String ( this . #coordinateTo. y + this . #toEntryDimentions . height / 2 ) ;
213+ const connectionPointY = String ( this . #coordinateTo. y + this . #toEntryDimensions . height / 2 ) ;
214214
215215 this . #connector. setAttribute ( 'x2' , connectionPointX ) ;
216216 this . #connector. setAttribute ( 'y2' , connectionPointY ) ;
@@ -222,10 +222,10 @@ export class EntriesLinkOverlay extends HTMLElement {
222222 } else {
223223 this . #entryToWrapper. style . visibility = 'hidden' ;
224224 this . #connector. setAttribute ( 'x2' , this . #coordinateTo. x . toString ( ) ) ;
225- // If `toEntryDimentions ` exist, the arrow points to the entry and we need to take its height into account.
225+ // If `toEntryDimensions ` exist, the arrow points to the entry and we need to take its height into account.
226226 // Otherwise, it is following the mouse.
227- if ( this . #toEntryDimentions ) {
228- const halfToEntryHeight = this . #toEntryDimentions . height / 2 ;
227+ if ( this . #toEntryDimensions ) {
228+ const halfToEntryHeight = this . #toEntryDimensions . height / 2 ;
229229 this . #connector. setAttribute ( 'y2' , String ( this . #coordinateTo. y + halfToEntryHeight ) ) ;
230230 } else {
231231 this . #connector. setAttribute ( 'y2' , ( this . #coordinateTo. y ) . toString ( ) ) ;
@@ -234,9 +234,9 @@ export class EntriesLinkOverlay extends HTMLElement {
234234
235235 this . #connector. setAttribute ( 'stroke-width' , '2' ) ;
236236
237- if ( this . #toEntryDimentions && this . #entryFromVisible && ! this . #entryToVisible) {
237+ if ( this . #toEntryDimensions && this . #entryFromVisible && ! this . #entryToVisible) {
238238 this . #connector. setAttribute ( 'stroke' , 'url(#fromVisibleLineGradient)' ) ;
239- } else if ( this . #toEntryDimentions && this . #entryToVisible && ! this . #entryFromVisible) {
239+ } else if ( this . #toEntryDimensions && this . #entryToVisible && ! this . #entryFromVisible) {
240240 this . #connector. setAttribute ( 'stroke' , 'url(#toVisibleLineGradient)' ) ;
241241 } else {
242242 const arrowColor = ThemeSupport . ThemeSupport . instance ( ) . getComputedValue ( '--color-text-primary' ) ;
@@ -260,15 +260,15 @@ export class EntriesLinkOverlay extends HTMLElement {
260260 return 100 ;
261261 }
262262
263- const lineLength = this . #coordinateTo. x - ( this . #coordinateFrom. x + this . #fromEntryDimentions . width ) ;
263+ const lineLength = this . #coordinateTo. x - ( this . #coordinateFrom. x + this . #fromEntryDimensions . width ) ;
264264 let visibleLineLength = 0 ;
265265
266266 // If the visible entry is the 'From' entry, find the length of the visible arrow by
267- // substracting the point where the arrow starts from the whole canvas length.
267+ // subtracting the point where the arrow starts from the whole canvas length.
268268 // If the 'to' entry is visible, the coordinate of the entry will be equal to
269269 // the visible arrow length.
270270 if ( this . #entryFromVisible && ! this . #entryToVisible) {
271- visibleLineLength = this . #canvasRect. width - ( this . #coordinateFrom. x + this . #fromEntryDimentions . width ) ;
271+ visibleLineLength = this . #canvasRect. width - ( this . #coordinateFrom. x + this . #fromEntryDimensions . width ) ;
272272 } else if ( ! this . #entryFromVisible && this . #entryToVisible) {
273273 visibleLineLength = this . #coordinateTo. x ;
274274 }
@@ -292,7 +292,7 @@ export class EntriesLinkOverlay extends HTMLElement {
292292 return ;
293293 }
294294
295- createLinkIcon . style . left = `${ this . #coordinateFrom. x + this . #fromEntryDimentions . width } px` ;
295+ createLinkIcon . style . left = `${ this . #coordinateFrom. x + this . #fromEntryDimensions . width } px` ;
296296 createLinkIcon . style . top = `${ this . #coordinateFrom. y } px` ;
297297 }
298298
@@ -351,7 +351,7 @@ export class EntriesLinkOverlay extends HTMLElement {
351351 fill-opacity ="1 "
352352 refX ="4 "
353353 refY ="2 "
354- visibility =${ this . #entryToVisible || ! this . #toEntryDimentions ? 'visible' : 'hidden' } >
354+ visibility =${ this . #entryToVisible || ! this . #toEntryDimensions ? 'visible' : 'hidden' } >
355355 < path d ="M0,0 V4 L4,2 Z " fill =${ arrowColor } / >
356356 </ marker >
357357 </ defs >
0 commit comments