1
0
Fork 0

feat(markdown): Ported code howtos to v3

This commit is contained in:
Joost De Cock 2022-10-12 14:42:45 +02:00
parent d1edf93750
commit af99d3e8c0
25 changed files with 451 additions and 636 deletions

View file

@ -1,22 +1,30 @@
---
title: Hide paths from an inherited part
for: developers
about: When you inherit a part, it comes with a bunch of paths. Here'show to hide them
title: Hide ore remove paths from an inherited part
---
<Note>
To hide remove paths from an inherited part, iterate over the `paths` object
and call `Path.hide()` on all entries:
##### See this example in our source code
- [designs/aaron/src/front.js](https://github.com/freesewing/freesewing/blob/3ca5d0edfe54c7ac20aaf3af2f3544aee72f9b99/designs/aaron/src/front.js#L22)
</Note>
The example below is from Aaron which inherits from Brian.
We iterate over the paths and set their render property to false.
```js
// Hide Brian paths
for (let key of Object.keys(paths)) paths[key].render = false
```mjs
for (const i in paths) paths[i].hide()
```
To outright remove the paths all together, delete them:
```mjs
for (const i in paths) delete paths[i]
```
<Warning>
Do __not__ replace the `path` object:
```mjs
paths = {}
```
as the `paths` object is more than a pojo (plain old javascript object)
</Warning>
<Tip>
You can use the same strategy for hiding or removing points or snippets.
</Tip>