Fix uninitialized value warning and code indentation
This commit is contained in:
parent
d605c91790
commit
2784950f45
10
src/x.c
10
src/x.c
@ -537,7 +537,7 @@ static void r_free_layouts(GSList *layouts)
|
|||||||
static dimension_t x_render_layout(cairo_t *c, colored_layout *cl, colored_layout *cl_next, dimension_t dim, bool first, bool last)
|
static dimension_t x_render_layout(cairo_t *c, colored_layout *cl, colored_layout *cl_next, dimension_t dim, bool first, bool last)
|
||||||
{
|
{
|
||||||
int h;
|
int h;
|
||||||
int h_text;
|
int h_text = 0;
|
||||||
pango_layout_get_pixel_size(cl->l, NULL, &h);
|
pango_layout_get_pixel_size(cl->l, NULL, &h);
|
||||||
if (cl->icon) {
|
if (cl->icon) {
|
||||||
h_text = h;
|
h_text = h;
|
||||||
@ -580,15 +580,15 @@ static dimension_t x_render_layout(cairo_t *c, colored_layout *cl, colored_layou
|
|||||||
dim.y += settings.padding;
|
dim.y += settings.padding;
|
||||||
else
|
else
|
||||||
dim.y += (int) (ceil(bg_half_height) - pango_offset);
|
dim.y += (int) (ceil(bg_half_height) - pango_offset);
|
||||||
|
|
||||||
if (cl->icon && settings.icon_position == icons_left) {
|
if (cl->icon && settings.icon_position == icons_left) {
|
||||||
cairo_move_to(c, settings.frame_width + cairo_image_surface_get_width(cl->icon) + 2 * settings.h_padding, bg_y + settings.padding + h/2 - h_text/2);
|
cairo_move_to(c, settings.frame_width + cairo_image_surface_get_width(cl->icon) + 2 * settings.h_padding, bg_y + settings.padding + h/2 - h_text/2);
|
||||||
}
|
} else if (cl->icon && settings.icon_position == icons_right) {
|
||||||
else if (cl->icon && settings.icon_position == icons_right) {
|
|
||||||
cairo_move_to(c, settings.frame_width + settings.h_padding, bg_y + settings.padding + h/2 - h_text/2);
|
cairo_move_to(c, settings.frame_width + settings.h_padding, bg_y + settings.padding + h/2 - h_text/2);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
cairo_move_to(c, settings.frame_width + settings.h_padding, bg_y + settings.padding);
|
cairo_move_to(c, settings.frame_width + settings.h_padding, bg_y + settings.padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_set_source_rgb(c, cl->fg.r, cl->fg.g, cl->fg.b);
|
cairo_set_source_rgb(c, cl->fg.r, cl->fg.g, cl->fg.b);
|
||||||
pango_cairo_update_layout(c, cl->l);
|
pango_cairo_update_layout(c, cl->l);
|
||||||
pango_cairo_show_layout(c, cl->l);
|
pango_cairo_show_layout(c, cl->l);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user