Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
fix: adjust height of square root
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed Jun 1, 2020
1 parent 54a9b97 commit c01ac60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [Unreleased]

### Bug Fixes

- Adjusted height of square root (there was some extra blank space above)

## 0.53.1 (2020-06-01)

### Bug Fixes
Expand Down
9 changes: 5 additions & 4 deletions src/core/span.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isArray } from '../common/types';

import { Style, ParseMode } from '../public/core';
import { getCharacterMetrics } from './font-metrics';
import { getCharacterMetrics, METRICS } from './font-metrics';
import { svgBodyToMarkup, svgBodyHeight } from './svg-span';
import { applyStyle as applyStyleForMode } from './modes-utils';
import { Context } from './context';
Expand Down Expand Up @@ -237,8 +237,8 @@ export class Span {
if (x.maxFontSize > maxFontSize) maxFontSize = x.maxFontSize;
});
} else if (typeof this.body === 'string') {
height = 0.7;
depth = 0.2;
height = METRICS.baselineskip;
depth = 0;
}
this.height = height;
this.depth = depth;
Expand Down Expand Up @@ -773,7 +773,8 @@ function makeFontSizer(context: Context, fontSize: number): Span {
? fontSize / context.mathstyle.sizeMultiplier
: 0;
const fontSizeInner = new Span('\u200b'); // ZERO WIDTH SPACE

fontSizeInner.depth = 0;
fontSizeInner.height = 0;
if (fontSizeAdjustment !== 1) {
fontSizeInner.setStyle(
'font-size',
Expand Down

0 comments on commit c01ac60

Please sign in to comment.