Skip to content

Commit 3fd350c

Browse files
committed
Website updates
1 parent c2c0f14 commit 3fd350c

File tree

9 files changed

+27
-9
lines changed

9 files changed

+27
-9
lines changed

dist/en/main/examples/common.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/offscreen-canvas.worker.worker.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/offscreen-canvas.worker.worker.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/render/canvas/Executor.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/render/canvas/Executor.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,20 @@ function createTextChunks(acc, line, i) {
112112
return acc;
113113
}
114114

115+
/**
116+
* Converts rich text to plain text for text along lines.
117+
* @param {string} result The resulting plain text.
118+
* @param {string} part Item of the rich text array.
119+
* @param {number} index Index of the item in the rich text array.
120+
* @return {string} The resulting plain text.
121+
*/
122+
function richTextToPlainText(result, part, index) {
123+
if (index % 2 === 0) {
124+
result += part;
125+
}
126+
return result;
127+
}
128+
115129
class Executor {
116130
/**
117131
* @param {number} resolution Resolution.
@@ -992,7 +1006,11 @@ class Executor {
9921006
const offsetY = /** @type {number} */ (instruction[8]);
9931007
strokeKey = /** @type {string} */ (instruction[9]);
9941008
const strokeWidth = /** @type {number} */ (instruction[10]);
995-
text = /** @type {string} */ (instruction[11]);
1009+
text = /** @type {string|Array<string>} */ (instruction[11]);
1010+
if (Array.isArray(text)) {
1011+
//FIXME Add support for rich text along lines
1012+
text = text.reduce(richTextToPlainText, '');
1013+
}
9961014
textKey = /** @type {string} */ (instruction[12]);
9971015
const pixelRatioScale = [
9981016
/** @type {number} */ (instruction[13]),

dist/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)