evolus / pencil

The Pencil Project's unique mission is to build a free and opensource tool for making diagrams and GUI prototyping that everyone can use.
http://pencil.evolus.vn
GNU General Public License v2.0
9.04k stars 717 forks source link

fixes the calculation of alignment for dynamic width shapes #692

Open EliotJones opened 3 years ago

EliotJones commented 3 years ago

This change aims to fix the behaviour of alignment for plain text type shapes (label, text box, box, etc). Previously the width for these was hardcoded at 2000 which means center and right alignment would cause the content to 'disappear' off the visible canvas.

This change allows types to define dynamic width so that alignment is calculated with respect to the longest line of content or container width, whichever is first.

See a video here for test cases and explanation: https://www.loom.com/share/db04a47c71124cf5a6d42e402f68dabc