d3plus / d3plus-text

A smart SVG text box with line wrapping and automatic font size scaling.
MIT License
105 stars 18 forks source link

fixes the lineHeight fontResize bug #85

Closed nbond211 closed 6 years ago

nbond211 commented 6 years ago

(closes #83 )

Description

The bug was caused by lineHeight being set to fontSize * 1.4 when fontResize is true in TextBox.js. To preserve the lineHeight to fontSize ratio when the font is resized, I calculate ratio = lineHeight / fontSize and then set lineHeight to fontSize * ratio when fontResize is true.

Types of changes

Checklist