mirror of
https://github.com/swaywm/sway.git
synced 2024-11-25 17:31:28 +00:00
Style fixes in swaybg
CONTRIBUTING.md's code example is sourced from this file, so I updated it as well.
This commit is contained in:
parent
392bfcbfb7
commit
9b62a98f3e
|
@ -123,8 +123,8 @@ int main(int argc, const char **argv) {
|
|||
(double) window->width/2 / scale - width/2,
|
||||
0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SCALING_MODE_FIT:
|
||||
{
|
||||
double window_ratio = (double) window->width / window->height;
|
||||
|
@ -143,8 +143,8 @@ int main(int argc, const char **argv) {
|
|||
0,
|
||||
(double) window->height/2 / scale - height/2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SCALING_MODE_CENTER:
|
||||
cairo_set_source_surface(window->cairo, image,
|
||||
(double) window->width/2 - width/2,
|
||||
|
@ -155,8 +155,8 @@ int main(int argc, const char **argv) {
|
|||
cairo_pattern_t *pattern = cairo_pattern_create_for_surface(image);
|
||||
cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
|
||||
cairo_set_source(window->cairo, pattern);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
sway_abort("Scaling mode '%s' not implemented yet!", scaling_mode_str);
|
||||
}
|
||||
|
|
|
@ -105,8 +105,8 @@ int main(int argc, const char **argv) {
|
|||
(double) window->width/2 / scale - width/2,
|
||||
0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SCALING_MODE_FIT:
|
||||
{
|
||||
double window_ratio = (double) window->width / window->height;
|
||||
|
@ -125,8 +125,8 @@ int main(int argc, const char **argv) {
|
|||
0,
|
||||
(double) window->height/2 / scale - height/2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SCALING_MODE_CENTER:
|
||||
cairo_set_source_surface(window->cairo, image,
|
||||
(double) window->width/2 - width/2,
|
||||
|
@ -137,8 +137,8 @@ int main(int argc, const char **argv) {
|
|||
cairo_pattern_t *pattern = cairo_pattern_create_for_surface(image);
|
||||
cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
|
||||
cairo_set_source(window->cairo, pattern);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
sway_abort("Scaling mode '%s' not implemented yet!", scaling_mode_str);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue