Fix extensible arrow sup vertical alignment (#1256)

* Fix extensible arrow sup vertical alignment

Fixes issue #1254

* Fix lint error

* Allow small depth
This commit is contained in:
Ron Kok
2018-05-09 06:27:30 -07:00
committed by ylemkimon
parent 49e673a59c
commit 42f305304b

View File

@@ -532,10 +532,10 @@ export const groupTypes = {
const arrowShift = -options.fontMetrics().axisHeight +
0.5 * arrowBody.height;
// 2 mu kern. Ref: amsmath.dtx: #7\if0#2\else\mkern#2mu\fi
let upperShift =
-options.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111;
if (group.value.label === "\\xleftequilibrium") {
upperShift -= upperGroup.depth;
let upperShift = -options.fontMetrics().axisHeight
- 0.5 * arrowBody.height - 0.111; // 0.111 em = 2 mu
if (upperGroup.depth > 0.25 || group.value.label === "\\xleftequilibrium") {
upperShift -= upperGroup.depth; // shift up if depth encroaches
}
// Generate the vlist