Skip to content

Commit

Permalink
Changed "other settings" to textareas
Browse files Browse the repository at this point in the history
Related: #8
  • Loading branch information
daem-on committed Aug 1, 2022
1 parent eeed4d8 commit 6fd90ad
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/export/processLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function processLine(item: paperExportedPath, settings?: LineSettings) {
// if (s.size !== undefined && s.size !== 0)
// o.push("-size " + s.size);
if (s.otherSettings !== "")
o.push(s.otherSettings.replace(";", "\n"));
o.push(s.otherSettings.replace(/\n/g, " "));
optionsString = o.join(" ");
}

Expand Down
2 changes: 1 addition & 1 deletion src/export/processPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function processPoint(item: any) {
if (s.rotation !== 0)
options += " -orientation " + s.rotation;
if (s.otherSettings)
options += " " + s.otherSettings;
options += " " + s.otherSettings.replace(/\n/g, " ");
}

addText("point", position, options);
Expand Down
4 changes: 2 additions & 2 deletions src/import/importTH2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function saveLineSettings() {

for (const key in o) {
if (Object.prototype.hasOwnProperty.call(o, key)) {
s.otherSettings += `-${key} ${o[key]} `;
s.otherSettings += `-${key} ${o[key]}\n`;
}
}
}
Expand Down Expand Up @@ -311,7 +311,7 @@ function savePointSettings(point: paper.Shape, options: Record<string, string>)

for (const key in o) {
if (Object.prototype.hasOwnProperty.call(o, key)) {
s.otherSettings += `-${key} ${o[key]} `;
s.otherSettings += `-${key} ${o[key]}\n`;
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/objectSettings/panels/lineOptionPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ const components: comp = {
type: "text",
label: "%id%"
},
otherSettings: {
type: "text",
label: "%otherSettings%"
},
clip: {
type: "list",
label: "%clip%",
Expand All @@ -109,6 +105,10 @@ const components: comp = {
["%default% ⦿", 0]
]
},
otherSettings: {
type: "textarea",
label: "%otherSettings%"
},
};

export default function(line: paper.Path): objectOptionPanelConfig {
Expand Down
8 changes: 4 additions & 4 deletions src/objectSettings/panels/pointOptionPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ const components: comp = {
type: "text",
label: "%id%"
},
otherSettings: {
type: "text",
label: "%otherSettings%"
},
clip: {
type: "list",
label: "%clip%",
Expand All @@ -91,6 +87,10 @@ const components: comp = {
["%default% ⦿", 0]
]
},
otherSettings: {
type: "textarea",
label: "%otherSettings%"
},
};

export default function(shape: paper.Shape): objectOptionPanelConfig {
Expand Down

0 comments on commit 6fd90ad

Please sign in to comment.