mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
src/common/graphic-helpers.c: fix declaration/definition arg name difference
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Some checks failed
labwc.github.io / notify (push) Has been cancelled
This commit is contained in:
parent
0d0d1075cc
commit
bed0be8a88
1 changed files with 8 additions and 8 deletions
|
|
@ -27,34 +27,34 @@ draw_cairo_border(cairo_t *cairo, struct wlr_fbox fbox, double line_width)
|
|||
|
||||
/* Sets the cairo color. Splits the single color channels */
|
||||
void
|
||||
set_cairo_color(cairo_t *cairo, const float *c)
|
||||
set_cairo_color(cairo_t *cairo, const float *color)
|
||||
{
|
||||
/*
|
||||
* We are dealing with pre-multiplied colors
|
||||
* but cairo expects unmultiplied colors here
|
||||
*/
|
||||
float alpha = c[3];
|
||||
float alpha = color[3];
|
||||
|
||||
if (alpha == 0.0f) {
|
||||
cairo_set_source_rgba(cairo, 0, 0, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
cairo_set_source_rgba(cairo, c[0] / alpha, c[1] / alpha,
|
||||
c[2] / alpha, alpha);
|
||||
cairo_set_source_rgba(cairo, color[0] / alpha, color[1] / alpha,
|
||||
color[2] / alpha, alpha);
|
||||
}
|
||||
|
||||
cairo_pattern_t *
|
||||
color_to_pattern(const float *c)
|
||||
color_to_pattern(const float *color)
|
||||
{
|
||||
float alpha = c[3];
|
||||
float alpha = color[3];
|
||||
|
||||
if (alpha == 0.0f) {
|
||||
return cairo_pattern_create_rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
return cairo_pattern_create_rgba(
|
||||
c[0] / alpha, c[1] / alpha, c[2] / alpha, alpha);
|
||||
return cairo_pattern_create_rgba(color[0] / alpha, color[1] / alpha,
|
||||
color[2] / alpha, alpha);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue