Skip to content

Commit

Permalink
SW-1326 the outline and the engraving is not matching the quicktext p…
Browse files Browse the repository at this point in the history
…review (#1541)

* SW-1326 Modify fill attribute and fill-opacity style

These attribute and styling should always be set to white and zero so that the outline path always have transparent filling. The filling of the quicktext is handled by another text element.

* SW-1326 Set stroke in the text element to none

This stroke is used to detect the availability of an outline. The outline will be handled in the .qt_outline element. This should be removed at the last point before added to the working area otherwise it will be lasered as a thick stroke included with the filling whenever filling and outline are checked together.
  • Loading branch information
khaledsherkawi authored Jul 19, 2022
1 parent 64cb806 commit 840632a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions octoprint_mrbeam/static/js/render_fills.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,12 @@ Snap.plugin(function (Snap, Element, Paper, global) {
// fill: "none", // removed to fill target path with white fill when no fill exists for easier cursor selection
})
.transform(mat);

// remove stroke from text element to avoid thick stroke engraving
// the .qt_outline element will be used for stroke cutting or engraving
elem.attr({
stroke: "none",
});
} else {
console.error("getFontOutline(): failed.");
}
Expand Down
4 changes: 2 additions & 2 deletions octoprint_mrbeam/static/js/working_area.js
Original file line number Diff line number Diff line change
Expand Up @@ -3921,8 +3921,8 @@ $(function () {
// add selected attributes to stroke path
g.select("path").attr({
stroke: strokeColor,
fill: isFilled ? fill : "#ffffff",
"fill-opacity": isFilled ? 1 : 0,
fill: "#ffffff",
"fill-opacity": 0,
});
} else {
qtOutlineGroup.select("path")?.remove();
Expand Down

0 comments on commit 840632a

Please sign in to comment.