Skip to content

Commit

Permalink
Fix more recursive updates
Browse files Browse the repository at this point in the history
  • Loading branch information
RoelN committed Nov 29, 2024
1 parent 3d9a029 commit 5810ce6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/components/report/FeatureControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export default {
long() {
return this.optionalFeatures.length > 8;
},
},
mounted: function () {
this.updateStyles();
},
methods: {
featureChars() {
// Try to return the "best" layout features
if (
Expand All @@ -39,11 +44,6 @@ export default {
return {};
}
},
},
mounted: function () {
this.updateStyles();
},
methods: {
flipState(feature) {
const states = [1, 0, null];
// If feature is on and showing alternates (so it's state >= 1),
Expand Down
6 changes: 5 additions & 1 deletion src/components/report/FontSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export default {
return {
summary: this.font.summary,
features: this.font.features,
hasLocalization: this.font.languageSystems.length > 0,
};
},
computed: {
Expand All @@ -29,4 +28,9 @@ export default {
return count || "no";
},
},
methods: {
hasLocalization() {
return this.font.languageSystems.length > 0;
},
},
};
19 changes: 10 additions & 9 deletions src/components/report/OpenTypeFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ export default {
data() {
return {
currentStates: [],
hasOptionalFeatures:
this.font.features.filter((f) => f.state !== "fixed").length >
0,
hasRequiredFeatures:
this.font.features.filter((f) => f.state === "fixed").length >
0,
featureChars: this.getFeatureChars(),
};
},
computed: {
Expand All @@ -12,13 +19,9 @@ export default {
requiredFeatures() {
return this.font.features.filter((f) => f.state === "fixed");
},
hasRequiredFeatures() {
return this.requiredFeatures.length > 0;
},
hasOptionalFeatures() {
return this.optionalFeatures.length > 0;
},
featureChars() {
},
methods: {
getFeatureChars() {
// Try to return the "best" layout features
if (
"DFLT" in this.font.featureChars &&
Expand All @@ -38,8 +41,6 @@ export default {
return {};
}
},
},
methods: {
flipState(feature) {
this.currentStates[feature] = 1 - this.currentStates[feature];
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/report/OpenTypeFeatures.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
v-if="lookup['type'] === 3"
:style="getFeatureStyle(feature.tag)"
:data-type="lookup['typeName']"
:key="`lookup_${feature.tag}_${index}`"
:key="`lookup_3_${feature.tag}_${index}`"
class="chars"
contenteditable
spellcheck="false"
Expand All @@ -86,7 +86,7 @@
v-else
:style="getFeatureStyle(feature.tag)"
:data-type="lookup['typeName']"
:key="`lookup_${feature.tag}_${index}`"
:key="`lookup_6_${feature.tag}_${index}`"
class="chars"
contenteditable
spellcheck="false"
Expand Down
4 changes: 3 additions & 1 deletion src/components/report/TypeTester.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default {
textStyles: "",
language: null,
sticky: false,
hasLocalization: this.font.languageSystems.length > 0,
};
},
computed: {
Expand Down Expand Up @@ -69,5 +68,8 @@ export default {
}
return css;
},
hasLocalization() {
return this.font.languageSystems.length > 0;
},
},
};

0 comments on commit 5810ce6

Please sign in to comment.