# Netlabel alignment feature

**URL:** <https://librepcb.discourse.group/t/netlabel-alignment-feature/378>\
**Category:** Improvement Ideas\
**Created:** [March 4, 2021, 3:39am UTC](https://librepcb.discourse.group/t/netlabel-alignment-feature/378 "2021-03-04T03:39:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjaminn](https://yyz2.discourse-cdn.com/free1/user_avatar/librepcb.discourse.group/bjaminn/32/252_2.png) [@bjaminn](https://librepcb.discourse.group/u/bjaminn)\
**Post date:** [March 4, 2021, 3:39am UTC](https://librepcb.discourse.group/t/netlabel-alignment-feature/378/1 "2021-03-04T03:39:38Z")

</div>

I have been interested in having the ability to right justify netlabels.  
I have created a working patch to demo it. Currently though it will crash if I do not have the property already added to the file. I am looking for feedback here to do this properly.

Additionally, I used the Alignment class so the netlabel can be aligned top, middle, bottom and left, center, right. Currently i have only added the mirror command so it can only swap from left to right. I am unsure what the appropriate approach is for long term and editing.

---

<div class="post-metadata">

**Author:** ![bjaminn](https://yyz2.discourse-cdn.com/free1/user_avatar/librepcb.discourse.group/bjaminn/32/252_2.png) [@bjaminn](https://librepcb.discourse.group/u/bjaminn)\
**Post date:** [March 6, 2021, 11:21pm UTC](https://librepcb.discourse.group/t/netlabel-alignment-feature/378/2 "2021-03-06T23:21:15Z")

</div>

I have made a pull request but realized afterwards that I can’t pass unittests unless I figure out how to migrate an old project without alignment attributes to a new one. I am looking at the constructor and can’t figure out how to say try to parse adn if you can’t find it add a default value. It seems like i should add a new function to node.getChild but with a default value. I would appreciate feedback if available on the right approach for this project.

Thanks,  
Ben

[https://github.com/LibrePCB/LibrePCB/pull/879](https://github.com/LibrePCB/LibrePCB/pull/879)

---

<div class="post-metadata">

**Author:** ![ubruhin](https://avatars.discourse-cdn.com/v4/letter/u/c89c15/32.png) [@ubruhin](https://librepcb.discourse.group/u/ubruhin)\
**Post date:** [March 7, 2021, 11:53am UTC](https://librepcb.discourse.group/t/netlabel-alignment-feature/378/3 "2021-03-07T11:53:45Z")

</div>

Hi Ben, sorry I did not see this topic earlier… Since the pull request is now open (thanks!), let’s continue the discussion right in the pull request 🙂
