Merge pull request #242 from kelvie/diff-tag-fix

Fix diff/intersect when some tags are hidden
This commit is contained in:
Revar Desmera
2020-08-25 22:50:48 -07:00
committed by GitHub

View File

@@ -1235,6 +1235,8 @@ module show(tags="")
// }
module diff(neg, pos=undef, keep=undef)
{
// Don't perform the operation if the current tags are hidden
if (attachment_is_shown($tags)) {
difference() {
if (pos != undef) {
show(pos) children();
@@ -1247,6 +1249,7 @@ module diff(neg, pos=undef, keep=undef)
}
show(neg) children();
}
}
if (keep!=undef) {
show(keep) children();
} else if (pos!=undef) {
@@ -1280,6 +1283,8 @@ module diff(neg, pos=undef, keep=undef)
// }
module intersect(a, b=undef, keep=undef)
{
// Don't perform the operation if the current tags are hidden
if (attachment_is_shown($tags)) {
intersection() {
if (b != undef) {
show(b) children();
@@ -1292,6 +1297,7 @@ module intersect(a, b=undef, keep=undef)
}
show(a) children();
}
}
if (keep!=undef) {
show(keep) children();
} else if (b!=undef) {