mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
common/font: Add scale argument
This commit is contained in:
parent
2aaf26e87b
commit
f3a685155d
4 changed files with 10 additions and 10 deletions
|
|
@ -51,18 +51,18 @@ font_height(struct font *font)
|
|||
|
||||
void
|
||||
font_buffer_update(struct lab_data_buffer **buffer, int max_width,
|
||||
const char *text, struct font *font, float *color)
|
||||
const char *text, struct font *font, float *color, double scale)
|
||||
{
|
||||
if (*buffer) {
|
||||
wlr_buffer_drop(&(*buffer)->base);
|
||||
*buffer = NULL;
|
||||
}
|
||||
font_buffer_create(buffer, max_width, text, font, color);
|
||||
font_buffer_create(buffer, max_width, text, font, color, scale);
|
||||
}
|
||||
|
||||
void
|
||||
font_buffer_create(struct lab_data_buffer **buffer, int max_width,
|
||||
const char *text, struct font *font, float *color)
|
||||
const char *text, struct font *font, float *color, double scale)
|
||||
{
|
||||
if (!text || !*text) {
|
||||
return;
|
||||
|
|
@ -72,8 +72,7 @@ font_buffer_create(struct lab_data_buffer **buffer, int max_width,
|
|||
if (max_width && rect.width > max_width) {
|
||||
rect.width = max_width;
|
||||
}
|
||||
/* TODO: scale */
|
||||
*buffer = buffer_create_cairo(rect.width, rect.height, 1, true);
|
||||
*buffer = buffer_create_cairo(rect.width, rect.height, scale, true);
|
||||
if (!*buffer) {
|
||||
wlr_log(WLR_ERROR, "Failed to create font buffer of size %dx%d",
|
||||
rect.width, rect.height);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue