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 <campbell@blender.org>2022-09-25 11:33:28 +0300
committerCampbell Barton <campbell@blender.org>2022-09-25 13:17:08 +0300
commitf68cfd6bb078482c4a779a6e26a56e2734edb5b8 (patch)
tree2878e5b80dba5bdeba186d99661d604eb38879cd /source/blender/editors/interface/interface_style.cc
parentc7b247a118e302a3afc6473797e53b6af28b69e2 (diff)
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/editors/interface/interface_style.cc')
-rw-r--r--source/blender/editors/interface/interface_style.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/editors/interface/interface_style.cc b/source/blender/editors/interface/interface_style.cc
index 3895a687033..9493f40548d 100644
--- a/source/blender/editors/interface/interface_style.cc
+++ b/source/blender/editors/interface/interface_style.cc
@@ -319,20 +319,20 @@ const uiStyle *UI_style_get_dpi(void)
_style = *style;
- _style.paneltitle.shadx = (short)(UI_DPI_FAC * _style.paneltitle.shadx);
- _style.paneltitle.shady = (short)(UI_DPI_FAC * _style.paneltitle.shady);
- _style.grouplabel.shadx = (short)(UI_DPI_FAC * _style.grouplabel.shadx);
- _style.grouplabel.shady = (short)(UI_DPI_FAC * _style.grouplabel.shady);
- _style.widgetlabel.shadx = (short)(UI_DPI_FAC * _style.widgetlabel.shadx);
- _style.widgetlabel.shady = (short)(UI_DPI_FAC * _style.widgetlabel.shady);
-
- _style.columnspace = (short)(UI_DPI_FAC * _style.columnspace);
- _style.templatespace = (short)(UI_DPI_FAC * _style.templatespace);
- _style.boxspace = (short)(UI_DPI_FAC * _style.boxspace);
- _style.buttonspacex = (short)(UI_DPI_FAC * _style.buttonspacex);
- _style.buttonspacey = (short)(UI_DPI_FAC * _style.buttonspacey);
- _style.panelspace = (short)(UI_DPI_FAC * _style.panelspace);
- _style.panelouter = (short)(UI_DPI_FAC * _style.panelouter);
+ _style.paneltitle.shadx = short(UI_DPI_FAC * _style.paneltitle.shadx);
+ _style.paneltitle.shady = short(UI_DPI_FAC * _style.paneltitle.shady);
+ _style.grouplabel.shadx = short(UI_DPI_FAC * _style.grouplabel.shadx);
+ _style.grouplabel.shady = short(UI_DPI_FAC * _style.grouplabel.shady);
+ _style.widgetlabel.shadx = short(UI_DPI_FAC * _style.widgetlabel.shadx);
+ _style.widgetlabel.shady = short(UI_DPI_FAC * _style.widgetlabel.shady);
+
+ _style.columnspace = short(UI_DPI_FAC * _style.columnspace);
+ _style.templatespace = short(UI_DPI_FAC * _style.templatespace);
+ _style.boxspace = short(UI_DPI_FAC * _style.boxspace);
+ _style.buttonspacex = short(UI_DPI_FAC * _style.buttonspacex);
+ _style.buttonspacey = short(UI_DPI_FAC * _style.buttonspacey);
+ _style.panelspace = short(UI_DPI_FAC * _style.panelspace);
+ _style.panelouter = short(UI_DPI_FAC * _style.panelouter);
return &_style;
}
@@ -340,7 +340,7 @@ const uiStyle *UI_style_get_dpi(void)
int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str)
{
UI_fontstyle_set(fs);
- return (int)BLF_width(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX);
+ return int(BLF_width(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX));
}
int UI_fontstyle_string_width_with_block_aspect(const uiFontStyle *fs,
@@ -359,7 +359,7 @@ int UI_fontstyle_string_width_with_block_aspect(const uiFontStyle *fs,
if (aspect != 1.0f) {
/* While in most cases rounding up isn't important, it can make a difference
* with small fonts (3px or less), zooming out in the node-editor for e.g. */
- width = (int)ceilf(width * aspect);
+ width = int(ceilf(width * aspect));
}
return width;
}