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

Function adjustTextX

libs/echarts/echarts.simple.js:7686–7695  ·  view source on GitHub ↗

* @public * @param {number} x * @param {number} width * @param {string} [textAlign='left'] * @return {number} Adjusted x.

(x, width, textAlign)

Source from the content-addressed store, hash-verified

7684 * @return {number} Adjusted x.
7685 */
7686function adjustTextX(x, width, textAlign) {
7687 // FIXME Right to left language
7688 if (textAlign === 'right') {
7689 x -= width;
7690 }
7691 else if (textAlign === 'center') {
7692 x -= width / 2;
7693 }
7694 return x;
7695}
7696
7697/**
7698 * @public

Callers 4

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

Calls

no outgoing calls

Tested by

no test coverage detected