1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Remove ABS in favor of Math::abs

This commit is contained in:
kobewi
2022-11-30 17:56:32 +01:00
parent 3d9b05ad4a
commit 10f6c01b9c
68 changed files with 142 additions and 146 deletions

View File

@@ -1453,10 +1453,10 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontAdvanced *p_f
if (FT_HAS_COLOR(fd->face) && fd->face->num_fixed_sizes > 0) {
int best_match = 0;
int diff = ABS(fd->size.x - ((int64_t)fd->face->available_sizes[0].width));
int diff = Math::abs(fd->size.x - ((int64_t)fd->face->available_sizes[0].width));
fd->scale = double(fd->size.x * fd->oversampling) / fd->face->available_sizes[0].width;
for (int i = 1; i < fd->face->num_fixed_sizes; i++) {
int ndiff = ABS(fd->size.x - ((int64_t)fd->face->available_sizes[i].width));
int ndiff = Math::abs(fd->size.x - ((int64_t)fd->face->available_sizes[i].width));
if (ndiff < diff) {
best_match = i;
diff = ndiff;