perf: set text-rendering to optimizeSpeed, v1.108.1

This commit is contained in:
Azgaar 2025-02-15 14:43:51 +01:00
parent 764993b680
commit d98ef5717e
13 changed files with 40 additions and 16 deletions

View file

@ -179,6 +179,7 @@ function addBurg(point) {
burgLabels
.select("#towns")
.append("text")
.attr("text-rendering", "optimizeSpeed")
.attr("id", "burgLabel" + i)
.attr("data-id", i)
.attr("x", x)
@ -464,6 +465,7 @@ function drawLegend(name, data) {
labels
.append("text")
.attr("text-rendering", "optimizeSpeed")
.text(data[i][2])
.attr("x", offset + colorBoxSize * 1.6)
.attr("y", fontSize / 1.6 + lineHeight + l * lineHeight + vOffset);
@ -474,6 +476,7 @@ function drawLegend(name, data) {
const offset = colOffset + legend.node().getBBox().width / 2;
labels
.append("text")
.attr("text-rendering", "optimizeSpeed")
.attr("text-anchor", "middle")
.attr("font-weight", "bold")
.attr("font-size", "1.2em")
@ -1290,7 +1293,7 @@ function refreshAllEditors() {
// dynamically loaded editors
async function editStates() {
if (customization) return;
const Editor = await import("../dynamic/editors/states-editor.js?v=1.106.1");
const Editor = await import("../dynamic/editors/states-editor.js?v=1.108.1");
Editor.open();
}

View file

@ -723,6 +723,7 @@ function drawCoordinates() {
.data(data)
.enter()
.append("text")
.attr("text-rendering", "optimizeSpeed")
.attr("x", d => d.x)
.attr("y", d => d.y)
.text(d => d.text);

View file

@ -706,6 +706,7 @@ function editProvinces() {
node
.append("text")
.attr("text-rendering", "optimizeSpeed")
.attr("dx", ".2em")
.attr("dy", "1em")
.attr("x", d => d.x0)

View file

@ -309,6 +309,7 @@ function editRegiment(selector) {
.on("end", () => new Battle(attacker, defender));
svg
.append("text")
.attr("text-rendering", "optimizeSpeed")
.attr("x", window.innerWidth / 2)
.attr("y", window.innerHeight / 2)
.text("⚔️")

View file

@ -618,8 +618,10 @@ function addLabelOnClick() {
group.classed("hidden", false);
group
.append("text")
.attr("text-rendering", "optimizeSpeed")
.attr("id", id)
.append("textPath")
.attr("text-rendering", "optimizeSpeed")
.attr("xlink:href", "#textPath_" + id)
.attr("startOffset", "50%")
.attr("font-size", "100%")