]> git.lyx.org Git - features.git/commit
Change a couple instances of QFontMetrics::width()
authorScott Kostyshak <skostysh@lyx.org>
Fri, 20 Mar 2020 13:39:51 +0000 (09:39 -0400)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:54 +0000 (15:48 +0200)
commit10cc4e54b8b9d0cbe62110232d8e53038b73da46
tree3bbb2ae57b3bd671b2fc7f34cf0afa47ada27893
parent5b90a76b97690456f65393065c92769f629d2631
Change a couple instances of QFontMetrics::width()

Use QFontMetrics::boundingRect() instead. QFontMetrics::width() does
not actually calculate the width of the bounding box and is mostly
useful for knowing where to draw text after a string, taking into
account bearings. Indeed, it has been renamed to
QFontMetrics::horizontalAdvance().

For the code touched in this commit, we want to center a string.
Either method would likely be fine, but it is more easy to
understand exactly what QFontMetrics::boundingRect() does.

This commit does change functionality, although it should not be
noticeable.
src/frontends/qt/CategorizedCombo.cpp
src/frontends/qt/LayoutBox.cpp