summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-09-13 10:24:59 +0200
committerDave Davenport <qball@gmpclient.org>2020-09-13 10:24:59 +0200
commit31fc5c9d350f752823a36196cadffbb3a28e619b (patch)
tree522ec444732295424cb8127cee7cad24721606ae /include
parent6ba878e44a3522928cad6d3c0dcb1aaa2bec311e (diff)
[Textbox] Try to fix estimated font height.
This was on newer pango 1 pixel off with actual font height. This casues drawing issues. Fixes: #1190
Diffstat (limited to 'include')
-rw-r--r--include/widgets/textbox.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/widgets/textbox.h b/include/widgets/textbox.h
index 229e34d9..cb9be121 100644
--- a/include/widgets/textbox.h
+++ b/include/widgets/textbox.h
@@ -43,6 +43,17 @@
*
* @{
*/
+
+/** Cache to hold font descriptions. This it to avoid having to lookup each time. */
+typedef struct TBFontConfig
+{
+ /** Font description */
+ PangoFontDescription *pfd;
+ /** Font metrics */
+ PangoFontMetrics *metrics;
+ /** height */
+ double height;
+}TBFontConfig;
/**
* Internal structure of a textbox widget.
* TODO make this internal to textbox
@@ -66,7 +77,8 @@ typedef struct
double yalign;
double xalign;
- PangoFontMetrics *metrics;
+ TBFontConfig *tbfc;
+
PangoEllipsizeMode emode;
//
const char *theme_name;