Ver Fonte

Use C style casting on numbers to keep code consistency

cosmy há 9 anos atrás
pai
commit
ad7aeafa10
1 ficheiros alterados com 4 adições e 4 exclusões
  1. 4 4
      Source/Urho3D/UI/FontFaceFreeType.cpp

+ 4 - 4
Source/Urho3D/UI/FontFaceFreeType.cpp

@@ -328,8 +328,8 @@ bool FontFaceFreeType::CanLoadAllGlyphs(const PODVector<unsigned>& charCodes, in
         FT_Error error = FT_Load_Char(face, charCode, loadMode_);
         if (!error)
         {
-            int width = Max(RoundToPixels(slot->metrics.width), static_cast<int>(slot->bitmap.width));
-            int height = Max(RoundToPixels(slot->metrics.height), static_cast<int>(slot->bitmap.rows));
+            int width = Max(RoundToPixels(slot->metrics.width), (int)slot->bitmap.width);
+            int height = Max(RoundToPixels(slot->metrics.height), (int)slot->bitmap.rows);
             int x, y;
             if (!allocator.Allocate(width + 1, height + 1, x, y))
                 return false;
@@ -373,8 +373,8 @@ bool FontFaceFreeType::LoadCharGlyph(unsigned charCode, Image* image)
     if (!error)
     {
         // Note: position within texture will be filled later
-        fontGlyph.width_ = (short)Max(RoundToPixels(slot->metrics.width), static_cast<int>(slot->bitmap.width));
-        fontGlyph.height_ = (short)Max(RoundToPixels(slot->metrics.height), static_cast<int>(slot->bitmap.rows));
+        fontGlyph.width_ = (short)Max(RoundToPixels(slot->metrics.width), (int)slot->bitmap.width);
+        fontGlyph.height_ = (short)Max(RoundToPixels(slot->metrics.height), (int)slot->bitmap.rows);
         fontGlyph.offsetX_ = (short)(RoundToPixels(slot->metrics.horiBearingX));
         fontGlyph.offsetY_ = (short)(ascender_ - RoundToPixels(slot->metrics.horiBearingY));
         fontGlyph.advanceX_ = (short)(slot->metrics.horiAdvance >> 6);