Skip to content

Commit

Permalink
Make edit layers persistent through in the URL fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Nov 27, 2024
1 parent 7b0c13a commit cfd1ece
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/fontra/views/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ export class EditorController {
this.sceneSettingsController.addKeyListener(
[
"align",
"editLayerName",
"editingLayers",
"fontLocationUser",
"glyphLocation",
"fontAxesUseSourceCoordinates",
Expand Down Expand Up @@ -3412,12 +3414,20 @@ export class EditorController {
if (viewInfo["fontAxesSkipMapping"]) {
this.sceneSettings.fontAxesSkipMapping = true;
}

if (viewInfo["location"]) {
this.sceneSettings.fontLocationUser = viewInfo["location"];
}

this.sceneSettings.selectedGlyph = viewInfo["selectedGlyph"];

if (viewInfo["editLayerName"]) {
this.sceneSettings.editLayerName = viewInfo["editLayerName"];
}
if (viewInfo["editingLayers"]) {
this.sceneSettings.editingLayers = viewInfo["editingLayers"];
}

if (viewInfo["selection"]) {
this.sceneSettings.selection = new Set(viewInfo["selection"]);
}
Expand Down Expand Up @@ -3456,6 +3466,14 @@ export class EditorController {
if (this.sceneSettings.fontAxesSkipMapping) {
viewInfo["fontAxesSkipMapping"] = true;
}

if (this.sceneSettings.editLayerName) {
viewInfo["editLayerName"] = this.sceneSettings.editLayerName;
}
if (Object.keys(this.sceneSettings.editingLayers).length) {
viewInfo["editingLayers"] = this.sceneSettings.editingLayers;
}

const glyphLocations = this.sceneController.getGlyphLocations(true);
if (Object.keys(glyphLocations).length) {
viewInfo["glyphLocations"] = glyphLocations;
Expand Down

0 comments on commit cfd1ece

Please sign in to comment.