File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 7272 & .underline {
7373 height : 0.1em ;
7474 width : 0.5em ;
75- margin-top : 1.2em ;
7675 }
7776}
Original file line number Diff line number Diff line change @@ -519,10 +519,15 @@ export class Caret {
519519 top += options . letter . offsetTop ;
520520 top += options . word . offsetTop ;
521521
522- // center the caret vertically and horizontally
523- if ( this . style !== "underline" ) {
522+ if ( this . style === "underline" ) {
523+ // if style is underline, add the height of the letter to the top
524+ top += options . letter . offsetHeight ;
525+ } else {
526+ // else center vertically in the letter
524527 top += ( options . letter . offsetHeight - this . getHeight ( ) ) / 2 ;
525528 }
529+
530+ // also center horizontally
526531 if ( ! this . isFullWidth ( ) ) {
527532 left += ( this . getWidth ( ) / 2 ) * - 1 ;
528533 }
You can’t perform that action at this time.
0 commit comments