Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-25 02:15:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-25 03:16:46 +0300
commite86e0aad55675a5c4473d0538146dbccda7613e8 (patch)
treef20540ba9e01cc8d7e13090df8fbf9691cb8b01b /source/blender/editors/interface/interface_style.c
parent72ede30d0f970fe7d6774ce0851e3aacc82e23d8 (diff)
Cleanup: use braces for interface code
Diffstat (limited to 'source/blender/editors/interface/interface_style.c')
-rw-r--r--source/blender/editors/interface/interface_style.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index f59bc5759e1..eecd5885c74 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -257,16 +257,19 @@ void UI_fontstyle_draw_rotated(const uiFontStyle *fs, const rcti *rect, const ch
BLF_shadow_offset(fs->uifont_id, fs->shadx, fs->shady);
}
- if (fs->kerning == 1)
+ if (fs->kerning == 1) {
BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT);
+ }
BLF_draw(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX);
BLF_disable(fs->uifont_id, BLF_ROTATION);
BLF_disable(fs->uifont_id, BLF_CLIPPING);
- if (fs->shadow)
+ if (fs->shadow) {
BLF_disable(fs->uifont_id, BLF_SHADOW);
- if (fs->kerning == 1)
+ }
+ if (fs->kerning == 1) {
BLF_disable(fs->uifont_id, BLF_KERNING_DEFAULT);
+ }
}
/**
@@ -277,16 +280,18 @@ void UI_fontstyle_draw_rotated(const uiFontStyle *fs, const rcti *rect, const ch
*/
void UI_fontstyle_draw_simple(const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
{
- if (fs->kerning == 1)
+ if (fs->kerning == 1) {
BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT);
+ }
UI_fontstyle_set(fs);
BLF_position(fs->uifont_id, x, y, 0.0f);
BLF_color4ubv(fs->uifont_id, col);
BLF_draw(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX);
- if (fs->kerning == 1)
+ if (fs->kerning == 1) {
BLF_disable(fs->uifont_id, BLF_KERNING_DEFAULT);
+ }
}
/**
@@ -296,8 +301,9 @@ void UI_fontstyle_draw_simple_backdrop(
const uiFontStyle *fs, float x, float y, const char *str,
const float col_fg[4], const float col_bg[4])
{
- if (fs->kerning == 1)
+ if (fs->kerning == 1) {
BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT);
+ }
UI_fontstyle_set(fs);
@@ -324,8 +330,9 @@ void UI_fontstyle_draw_simple_backdrop(
BLF_color4fv(fs->uifont_id, col_fg);
BLF_draw(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX);
- if (fs->kerning == 1)
+ if (fs->kerning == 1) {
BLF_disable(fs->uifont_id, BLF_KERNING_DEFAULT);
+ }
}
@@ -373,14 +380,17 @@ int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str)
{
int width;
- if (fs->kerning == 1) /* for BLF_width */
+ if (fs->kerning == 1) {
+ /* for BLF_width */
BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT);
+ }
UI_fontstyle_set(fs);
width = BLF_width(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX);
- if (fs->kerning == 1)
+ if (fs->kerning == 1) {
BLF_disable(fs->uifont_id, BLF_KERNING_DEFAULT);
+ }
return width;
}
@@ -404,8 +414,9 @@ void uiStyleInit(void)
uchar *monofont_ttf = (uchar *)datatoc_bmonofont_ttf;
/* recover from uninitialized dpi */
- if (U.dpi == 0)
+ if (U.dpi == 0) {
U.dpi = 72;
+ }
CLAMP(U.dpi, 48, 144);
for (font = U.uifonts.first; font; font = font->next) {
@@ -479,8 +490,9 @@ void uiStyleInit(void)
BLF_default_set(font->blf_id);
if (font->blf_id == -1) {
- if (G.debug & G_DEBUG)
+ if (G.debug & G_DEBUG) {
printf("%s: error, no fonts available\n", __func__);
+ }
}
else {
/* ? just for speed to initialize?
@@ -563,8 +575,9 @@ void uiStyleInit(void)
* \note This isn't good that the render font depends on the preferences,
* keep for now though, since without this there is no way to display many unicode chars.
*/
- if (blf_mono_font_render == -1)
+ if (blf_mono_font_render == -1) {
blf_mono_font_render = BLF_load_mem_unique("monospace", monofont_ttf, monofont_size);
+ }
BLF_size(blf_mono_font_render, 12 * U.pixelsize, 72);
}