File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,11 +180,13 @@ class TextTool extends paper.Tool {
180180 // edge. We need to correct for this in order for the element to overlap the object in paper.
181181 let tx = 0 ;
182182 if ( ( this . alignment === "right" ) && this . element . parentElement ) {
183- tx = - this . element . parentElement . clientWidth ;
183+ if ( window . test ) tx = window . test ( { } , this , textBoxMtx ) ;
184+ else tx = - this . element . parentElement . clientWidth ;
184185 }
185186 if ( ( this . alignment === "center" ) && this . element . parentElement ) {
186187 const bounds = this . textBox . getBounds ( ) ;
187- tx = bounds . x / ( 1 + paper . view . zoom * 0.5 ) ;
188+ if ( window . test ) tx = window . test ( bounds , this , textBoxMtx ) ;
189+ else tx = bounds . x / ( 1 + paper . view . zoom * 0.5 ) ;
188190 }
189191 // The transform origin in paper is x at justification side, y at the baseline of the text.
190192 // The offset from (0, 0) to the upper left corner is recorded by internalBounds
You can’t perform that action at this time.
0 commit comments