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:
Drew DeVault 2015-11-27 16:16:40 -05:00
parent 392bfcbfb7
commit 9b62a98f3e
2 changed files with 74 additions and 74 deletions

View File

@ -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);
}

View File

@ -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);
}