+
diff --git a/packages/components/src/Workbench/index.js b/packages/components/src/Workbench/index.js
index 933cd28aa35..8e6bfa35c49 100644
--- a/packages/components/src/Workbench/index.js
+++ b/packages/components/src/Workbench/index.js
@@ -58,6 +58,7 @@ const Workbench = props => {
};
const measurementsMissing = () => {
let required = props.config.measurements;
+ if (required.length < 1) return false;
if (measurements === null) return true;
for (let m of required) {
if (typeof measurements[m] === "undefined") return true;
diff --git a/packages/core/src/pattern.js b/packages/core/src/pattern.js
index 143a598470a..c086f1c7e14 100644
--- a/packages/core/src/pattern.js
+++ b/packages/core/src/pattern.js
@@ -595,7 +595,7 @@ Pattern.prototype.getRenderProps = function() {
props.parts[p] = {
paths: this.parts[p].paths,
points: this.parts[p].points,
- snippets: this.parts[p].points,
+ snippets: this.parts[p].snippets,
attributes: this.parts[p].attributes,
height: this.parts[p].height,
width: this.parts[p].width,
diff --git a/packages/css-theme/src/_variables.scss b/packages/css-theme/src/_variables.scss
index b5c71e37e80..b6717671ae6 100644
--- a/packages/css-theme/src/_variables.scss
+++ b/packages/css-theme/src/_variables.scss
@@ -11,14 +11,14 @@ $fc-accentbg-dark: $oc-teal-8;
$fc-link-light: $oc-blue-6;
$fc-link-dark: $oc-blue-3;
-$fc-draft-lining-light: $oc-teal-6;
$fc-draft-fabric-light: $oc-gray-9;
+$fc-draft-lining-light: $oc-lime-7;
+$fc-draft-interfacing-light: $oc-red-7;
$fc-draft-canvas-light: $oc-yellow-7;
-$fc-draft-interfacing-light: $oc-gray-6;
-$fc-draft-various-light: $oc-pink-5;
-$fc-draft-mark-light: $oc-indigo-6;
+$fc-draft-various-light: $oc-grape-7;
+$fc-draft-mark-light: $oc-blue-4;
$fc-draft-contrast-light: $oc-orange-7;
-$fc-draft-note-light: $oc-blue-7;
+$fc-draft-note-light: $oc-pink-7;
$fc-draft-lining-dark: $oc-teal-6;
$fc-draft-fabric-dark: $oc-gray-9;
diff --git a/packages/css-theme/src/components/_draft.scss b/packages/css-theme/src/components/_draft.scss
index 5e03c7f37c9..8fa1b0d6cee 100644
--- a/packages/css-theme/src/components/_draft.scss
+++ b/packages/css-theme/src/components/_draft.scss
@@ -1,8 +1,7 @@
svg.freesewing.draft {
max-width: 100%;
- max-height: 90vh;
/* Reset */
- path,circle,rect{fill:none;stroke:none}
+ path,circle{fill:none;stroke:none}
/* Defaults */
path,circle{
@@ -13,25 +12,22 @@ svg.freesewing.draft {
}
/* Stroke classes */
- .note{ stroke-width:.8; }
- .mark{ stroke-width:.8; }
- .contrast{ stroke-width:1.2; }
- .stroke-xs{ stroke-width:.5; }
- .stroke-sm{ stroke-width:.5; }
- .stroke-xl{ stroke-width:1.4; }
- .stroke-xxl{ stroke-width:2.4; }
+ .stroke-xs{ stroke-width:.1; }
+ .stroke-sm{ stroke-width:.4; }
+ .stroke-l{ stroke-width:1.3; }
+ .stroke-xl{ stroke-width:2; }
.sa { stroke-dasharray:1,3; }
.help {
stroke-width:.6;
stroke-dasharray:15,5,2,5;
}
- .dotted { stroke-dasharray:2,3; }
- .dashed { stroke-dasharray:2,5; }
- .lashed { stroke-dasharray:8,8; }
+ .dotted { stroke-dasharray:0.5,1; }
+ .dashed { stroke-dasharray:2,2; }
+ .lashed { stroke-dasharray:8,3; }
.hidden {
- stroke:none;
- fill:none;
+ stroke:none!important;
+ fill:none!important;
}
/* Sampling */
@@ -47,7 +43,7 @@ svg.freesewing.draft {
}
.text-xs { font-size:4px; }
.text-sm { font-size:5px; }
- .text-lg { font-size:8px; }
+ .text-l { font-size:8px; }
.text-xl { font-size:10px; }
.text-xxl{ font-size:13px; }
@@ -106,3 +102,52 @@ svg.freesewing.draft {
.fill-note{ fill: $fc-draft-note-dark; }
}
+/* SVG defs (snippets) are in the shadow DOM */
+g.snippet.notch > circle,
+g.snippet.bnotch > circle,
+g.snippet.bnotch > path,
+g.snippet.utton > circle,
+g.snippet.uttonhole > path {
+ color: $fc-draft-mark-light;
+}
+/* Same for paperless grid, also in shadow DOM */
+rect.grid {
+ stroke-width: 1;
+ stroke: currentColor;
+}
+path.gridline {
+ stroke-linecap: butt;
+ stroke-width: 0.3!important;
+ stroke-dasharray: none;
+}
+path.gridline.sm {
+ stroke-width: 0.15!important;
+}
+path.gridline.xs {
+ stroke-width: 0.1!important;
+}
+path.gridline.metric.sm {
+ stroke-dasharray: 3 1;
+}
+path.gridline.metric.xs {
+ stroke-dasharray: 1 1;
+}
+path.gridline.imperial {
+ stroke-dasharray: 5 5;
+}
+path.gridline.imperial.sm {
+ stroke-dasharray: 2 2;
+}
+.light {
+ rect.grid,
+ path.gridline {
+ color: $oc-gray-5!important;
+ }
+}
+.dark {
+ rect.grid,
+ path.gridline {
+ color: $oc-gray-6!important;
+ }
+}
+
diff --git a/packages/i18n/src/locales/de/plugin/plugins/scalebox.yaml b/packages/i18n/src/locales/de/plugin/plugins/scalebox.yaml
index fa184c01da7..c23d7129ba7 100644
--- a/packages/i18n/src/locales/de/plugin/plugins/scalebox.yaml
+++ b/packages/i18n/src/locales/de/plugin/plugins/scalebox.yaml
@@ -1,5 +1,5 @@
---
freesewingIsMadeByJoostDeCockAndContributors: Freesewing wurde von Joost De Cock und den Mitwirkenden kreiert
-theBlackOutsideOfThisBoxShouldMeasure: Die (schwarze) Außenseite dieses Rechtecks sollte messen
-theWhiteInsideOfThisBoxShouldMeasure: Die (weiße) Innenseite dieses Rechtecks sollte messen
+theBlackOutsideOfThisBoxShouldMeasure: Die Außenseite dieses Rechtecks sollte messen
+theWhiteInsideOfThisBoxShouldMeasure: Die Innenseite dieses Rechtecks sollte messen
withTheFinancialSupportOfOurPatrons: mit der finanziellen Unterstützung unserer Gönner
diff --git a/packages/i18n/src/locales/en/plugin/plugins/scalebox.yaml b/packages/i18n/src/locales/en/plugin/plugins/scalebox.yaml
index d9963c82ef1..8edb31bd3f1 100644
--- a/packages/i18n/src/locales/en/plugin/plugins/scalebox.yaml
+++ b/packages/i18n/src/locales/en/plugin/plugins/scalebox.yaml
@@ -1,4 +1,4 @@
freesewingIsMadeByJoostDeCockAndContributors: Freesewing is made by Joost De Cock and contributors
-theBlackOutsideOfThisBoxShouldMeasure: The (black) outside of this box should measure
-theWhiteInsideOfThisBoxShouldMeasure: The (white) inside of this box should measure
+theBlackOutsideOfThisBoxShouldMeasure: The outside of this box should measure
+theWhiteInsideOfThisBoxShouldMeasure: The inside of this box should measure
withTheFinancialSupportOfOurPatrons: with the financial support of our patrons
diff --git a/packages/i18n/src/locales/es/plugin/plugins/scalebox.yaml b/packages/i18n/src/locales/es/plugin/plugins/scalebox.yaml
index 609b705b3d3..d992ab20c3c 100644
--- a/packages/i18n/src/locales/es/plugin/plugins/scalebox.yaml
+++ b/packages/i18n/src/locales/es/plugin/plugins/scalebox.yaml
@@ -1,5 +1,5 @@
---
freesewingIsMadeByJoostDeCockAndContributors: Freesewing está hecho por Joost De Cock y colaboradores
-theBlackOutsideOfThisBoxShouldMeasure: El (negro) fuera de este cuadro debe medir
-theWhiteInsideOfThisBoxShouldMeasure: El (blanco) dentro de este cuadro debe medir
+theBlackOutsideOfThisBoxShouldMeasure: El fuera de este cuadro debe medir
+theWhiteInsideOfThisBoxShouldMeasure: El dentro de este cuadro debe medir
withTheFinancialSupportOfOurPatrons: con el apoyo económico de nuestros patrocinadores
diff --git a/packages/i18n/src/locales/fr/plugin/plugins/scalebox.yaml b/packages/i18n/src/locales/fr/plugin/plugins/scalebox.yaml
index 80cf5214269..14347b18909 100644
--- a/packages/i18n/src/locales/fr/plugin/plugins/scalebox.yaml
+++ b/packages/i18n/src/locales/fr/plugin/plugins/scalebox.yaml
@@ -1,5 +1,5 @@
---
freesewingIsMadeByJoostDeCockAndContributors: Freesewing est la création de Joost De Cock et ses contributeurs
-theBlackOutsideOfThisBoxShouldMeasure: Le (noir) en dehors de cette case doit mesurer
-theWhiteInsideOfThisBoxShouldMeasure: L'intérieur (blanc) de cette case doit mesurer
+theBlackOutsideOfThisBoxShouldMeasure: L'extérieur de cette case doit mesurer
+theWhiteInsideOfThisBoxShouldMeasure: L'intérieur de cette case doit mesurer
withTheFinancialSupportOfOurPatrons: avec le soutien financier de nos mécènes
diff --git a/packages/i18n/src/locales/nl/plugin/plugins/scalebox.yaml b/packages/i18n/src/locales/nl/plugin/plugins/scalebox.yaml
index 7de753a8e4e..c0b1efca671 100644
--- a/packages/i18n/src/locales/nl/plugin/plugins/scalebox.yaml
+++ b/packages/i18n/src/locales/nl/plugin/plugins/scalebox.yaml
@@ -1,5 +1,5 @@
---
freesewingIsMadeByJoostDeCockAndContributors: FreeSewing is een project van Joost De Cock en vrijwillige medewerkers
-theBlackOutsideOfThisBoxShouldMeasure: De (zwarte) buitenkant van dit kader meet
-theWhiteInsideOfThisBoxShouldMeasure: De (witte) binnenkant van dit kader meet
+theBlackOutsideOfThisBoxShouldMeasure: De buitenkant van dit kader meet
+theWhiteInsideOfThisBoxShouldMeasure: De binnenkant van dit kader meet
withTheFinancialSupportOfOurPatrons: met de financiële steun van onze mecenassen
diff --git a/packages/plugin-scalebox/src/index.js b/packages/plugin-scalebox/src/index.js
index c861151f502..957271e732a 100644
--- a/packages/plugin-scalebox/src/index.js
+++ b/packages/plugin-scalebox/src/index.js
@@ -86,14 +86,14 @@ export default {
.line(this.points.__scaleboxImperialBottomRight)
.line(this.points.__scaleboxImperialTopRight)
.close()
- .attr("style", "fill: #000; stroke: none;");
+ .attr("class", "scalebox imperial");
this.paths.__scaleboxMetric = new this.Path()
.move(this.points.__scaleboxMetricTopLeft)
.line(this.points.__scaleboxMetricBottomLeft)
.line(this.points.__scaleboxMetricBottomRight)
.line(this.points.__scaleboxMetricTopRight)
.close()
- .attr("style", "fill: #FFF; stroke: none;");
+ .attr("class", "scalebox metric");
// Lead
this.points.__scaleboxLead = this.points.__scaleboxLead
.attr("data-text", so.lead || "freesewing")
diff --git a/packages/rendertest/config/index.js b/packages/rendertest/config/index.js
new file mode 100644
index 00000000000..8ec60b6c6f1
--- /dev/null
+++ b/packages/rendertest/config/index.js
@@ -0,0 +1,23 @@
+import { version } from "../package.json";
+
+export default {
+ name: "rendertest",
+ version,
+ design: "Joost De Cock",
+ code: "Joost De Cock",
+ department: "menswear",
+ type: "pattern",
+ difficulty: 1,
+ tags: ["test"],
+ optionGroups: {
+ fit: ["width"]
+ },
+ measurements: [],
+ dependencies: {},
+ parts: ["colors"],
+ inject: {},
+ hide: [],
+ options: {
+ width: { mm: 200, min: 50, max: 500 }
+ }
+};
diff --git a/packages/rendertest/src/.eslintrc b/packages/rendertest/src/.eslintrc
new file mode 100644
index 00000000000..55f121d152d
--- /dev/null
+++ b/packages/rendertest/src/.eslintrc
@@ -0,0 +1,5 @@
+{
+ "env": {
+ "jest": true
+ }
+}
diff --git a/packages/rendertest/src/colors.js b/packages/rendertest/src/colors.js
new file mode 100644
index 00000000000..2b3f89b8c1a
--- /dev/null
+++ b/packages/rendertest/src/colors.js
@@ -0,0 +1,249 @@
+export default function(part) {
+ let {
+ macro,
+ options,
+ Point,
+ Path,
+ points,
+ paths,
+ snippets,
+ Snippet,
+ complete,
+ paperless
+ } = part.shorthand();
+
+ let colors = [
+ "fabric",
+ "lining",
+ "interfacing",
+ "canvas",
+ "various",
+ "mark",
+ "contrast",
+ "note"
+ ];
+ let sizes = ["xs", "sm", "", "l", "xl"];
+ let utility = ["dotted", "dashed", "lashed", "sa", "help", "hidden"];
+
+ let y = 0;
+ let w = options.width;
+ macro("hd", {
+ from: new Point(0, y),
+ to: new Point(w, y)
+ });
+ for (let i in colors) {
+ y += 15;
+ points["l" + i] = new Point(0, y);
+ points["r" + i] = new Point(w, y);
+ paths["heading" + i] = new Path()
+ .move(points["l" + i])
+ .line(points["r" + i])
+ .attr("class", colors[i])
+ .attr("data-text", colors[i]);
+ for (let j in sizes) {
+ y += 10;
+ points["sl" + i + j] = new Point(0, y);
+ points["sr" + i + j] = new Point(w, y);
+ paths["size" + i + j] = new Path()
+ .move(points["sl" + i + j])
+ .line(points["sr" + i + j])
+ .attr("class", colors[i])
+ .attr("class", "stroke-" + sizes[j])
+ .attr(
+ "data-text",
+ "path." + colors[i] + (sizes[j] === "" ? "" : ".stroke-" + sizes[j])
+ )
+ .attr("data-text-class", "center");
+ }
+ for (let j in utility) {
+ y += 10;
+ points["ul" + i + j] = new Point(0, y);
+ points["ur" + i + j] = new Point(w, y);
+ paths["util" + i + j] = new Path()
+ .move(points["ul" + i + j])
+ .line(points["ur" + i + j])
+ .attr("class", colors[i])
+ .attr("class", utility[j])
+ .attr("data-text", "path." + colors[i] + "." + utility[j])
+ .attr("data-text-class", "center");
+ }
+ }
+
+ y += 10;
+ points.ftl = new Point(0, y);
+ points.ftr = new Point(w, y);
+ paths.snip = new Path()
+ .move(points.ftl)
+ .line(points.ftr)
+ .attr("data-text", "fill");
+ y += 15;
+ for (let i of colors) {
+ let h = 10;
+ points["_bl" + i] = new Point(0, y);
+ points["_br" + i] = new Point(w, y);
+ points["_tr" + i] = new Point(w, y - h);
+ points["_tl" + i] = new Point(0, y - h);
+ paths["box" + i] = new Path()
+ .move(points["_bl" + i])
+ .line(points["_br" + i])
+ .line(points["_tr" + i])
+ .line(points["_tl" + i])
+ .close()
+ .attr("class", i)
+ .attr("class", "fill-" + i)
+ .attr("data-text", ".fill-" + i);
+ if (i === "fabric") paths["box" + i].attr("data-text-class", "fill-canvas");
+ y += h * 1.2;
+ }
+
+ let text = ["xs", "sm", "", "l", "xl", "xxl"];
+ y += 10;
+ points.tl = new Point(0, y);
+ points.tr = new Point(w, y);
+ paths.text = new Path()
+ .move(points.tl)
+ .line(points.tr)
+ .attr("data-text", "text");
+ y += 10;
+ points.tlc = new Point(0, y);
+ points.trc = new Point(w, y);
+ paths.textc = new Path()
+ .move(points.tlc)
+ .line(points.trc)
+ .attr("data-text", "text.center")
+ .attr("data-text-class", "center");
+ y += 10;
+ points.tlr = new Point(0, y);
+ points.trr = new Point(w, y);
+ paths.textr = new Path()
+ .move(points.tlr)
+ .line(points.trr)
+ .attr("data-text", "text.right")
+ .attr("data-text-class", "right");
+ for (let i in text) {
+ y += 15;
+ points["t" + i] = new Point(0, y)
+ .attr("data-text", "text" + text[i] === "" ? "" : ".text-" + text[i])
+ .attr("data-text-class", "text-" + text[i]);
+ }
+ let snips = {
+ logo: 25,
+ notch: 15,
+ bnotch: 15,
+ button: 15,
+ buttonhole: 15
+ };
+ y += 10;
+ points.tl = new Point(0, y);
+ points.tr = new Point(w, y);
+ paths.texts = new Path()
+ .move(points.tl)
+ .line(points.tr)
+ .attr("data-text", "snippets");
+ y += 10;
+ points["sl1"] = new Point(w * 0.25, y);
+ points["sl2"] = new Point(w * 0.5, y);
+ points["sl3"] = new Point(w * 0.75, y);
+ points["sl1"]
+ .attr("data-text", "data-scale: 1\ndata-rotate: 0")
+ .attr("data-text-class", "center text-sm")
+ .attr("data-text-lineheight", 5);
+ points["sl2"]
+ .attr("data-text", "data-scale: 1.25\ndata-rotate: 0")
+ .attr("data-text-class", "center text-sm")
+ .attr("data-text-lineheight", 5);
+ points["sl3"]
+ .attr("data-text", "data-scale: 0.75\ndata-rotate: 90")
+ .attr("data-text-class", "center text-sm")
+ .attr("data-text-lineheight", 5);
+ y += 55;
+ for (let i in snips) {
+ points["snt" + i] = new Point(0, y);
+ points["snt" + i].attr("data-text", i);
+ points["sn1" + i] = new Point(w * 0.25, y);
+ points["sn2" + i] = new Point(w * 0.5, y);
+ points["sn3" + i] = new Point(w * 0.75, y);
+ snippets["sn1" + i] = new Snippet(i, points["sn1" + i]);
+ snippets["sn2" + i] = new Snippet(i, points["sn2" + i]);
+ snippets["sn2" + i].attr("data-scale", 1.25);
+ snippets["sn3" + i] = new Snippet(i, points["sn3" + i]);
+ snippets["sn3" + i].attr("data-scale", 0.75).attr("data-rotate", 90);
+ y += snips[i];
+ }
+
+ y += 10;
+ points.ml = new Point(0, y);
+ points.mr = new Point(w, y);
+ paths.macros = new Path()
+ .move(points.ml)
+ .line(points.mr)
+ .attr("data-text", "macros");
+
+ y += 40;
+ macro("title", {
+ at: new Point(w / 2, y),
+ nr: 5,
+ title: "title"
+ });
+
+ y += 40;
+ macro("grainline", {
+ from: new Point(0, y),
+ to: new Point(w, y)
+ });
+
+ y += 20;
+ macro("cutonfold", {
+ from: new Point(w, y),
+ to: new Point(0, y)
+ });
+
+ y += 70;
+ points.dimf = new Point(20, y);
+ points.dimt = new Point(w - 20, y + 120);
+ points.dimv = new Point(20, y + 80);
+ paths.dims = new Path().move(points.dimf)._curve(points.dimv, points.dimt);
+ macro("hd", {
+ from: points.dimf,
+ to: points.dimt,
+ text: "hd",
+ y: y - 15
+ });
+ macro("vd", {
+ from: points.dimt,
+ to: points.dimf,
+ text: "vd",
+ x: 0
+ });
+ macro("ld", {
+ from: points.dimf,
+ to: points.dimt,
+ text: "ld"
+ });
+ macro("pd", {
+ path: paths.dims,
+ text: "pd",
+ d: 10
+ });
+
+ y += 170;
+ macro("scalebox", {
+ at: new Point(w / 2, y)
+ });
+
+ // Make sure nothing is cut off
+ paths.box = new Path()
+ .move(new Point(-10, -10))
+ .line(new Point(w + 10, y + 10))
+ .attr("class", "hidden");
+
+ // Complete?
+ if (complete) {
+ }
+
+ // Paperless?
+ if (paperless) {
+ }
+
+ return part;
+}
diff --git a/packages/rendertest/src/index.js b/packages/rendertest/src/index.js
new file mode 100644
index 00000000000..b8dcbd5fdc1
--- /dev/null
+++ b/packages/rendertest/src/index.js
@@ -0,0 +1,13 @@
+import freesewing from "@freesewing/core";
+import plugins from "@freesewing/plugin-bundle";
+import config from "../config";
+// Parts
+import draftColors from "./colors";
+
+// Create design
+const Pattern = new freesewing.Design(config, plugins);
+
+// Attach draft methods to prototype
+Pattern.prototype.draftColors = part => draftColors(part);
+
+export default Pattern;