MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / adjustTextY

Function adjustTextY

libs/echarts/echarts-en.simple.js:7704–7712  ·  view source on GitHub ↗

* @public * @param {number} y * @param {number} height * @param {string} [textVerticalAlign='top'] * @return {number} Adjusted y.

(y, height, textVerticalAlign)

Source from the content-addressed store, hash-verified

7702 * @return {number} Adjusted y.
7703 */
7704function adjustTextY(y, height, textVerticalAlign) {
7705 if (textVerticalAlign === 'middle') {
7706 y -= height / 2;
7707 }
7708 else if (textVerticalAlign === 'bottom') {
7709 y -= height;
7710 }
7711 return y;
7712}
7713
7714/**
7715 * Follow same interface to `Displayable.prototype.calculateTextPosition`.

Callers 4

getPlainTextRectFunction · 0.70
getRichTextRectFunction · 0.70
renderPlainTextFunction · 0.70
drawRichTextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected