mirror of
https://codeberg.org/adnano/wmenu.git
synced 2026-02-14 04:27:49 -05:00
Only call render_menu once per frame
An actual surface is not needed to estimate font sizes; a 1x1 image will do, as long as the cairo context has the same options.
This commit is contained in:
parent
260eaba88e
commit
0947765fc9
3 changed files with 16 additions and 3 deletions
5
menu.h
5
menu.h
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef WMENU_MENU_H
|
||||
#define WMENU_MENU_H
|
||||
|
||||
#include <cairo/cairo.h>
|
||||
#include <stdbool.h>
|
||||
#include <sys/types.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
|
@ -51,6 +52,10 @@ struct menu {
|
|||
|
||||
struct wl_context *context;
|
||||
|
||||
// 1x1 surface used estimate text sizes with pango
|
||||
cairo_surface_t *test_surface;
|
||||
cairo_t *test_cairo;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int line_height;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue