fix multiple-lines elements
Merge pull request #1241 from evindor/rects

Fix multi-line elements #1138