comparison Framework/Fonts/OpenGLTextCoordinates.cpp @ 693:9a474e90e832

Fixed a bunch of truncation warnings in various parts of the library
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 17 May 2019 08:49:55 +0200
parents b098a3aaf694
children 2d8ab34c8c91
comparison
equal deleted inserted replaced
692:10910827f235 693:9a474e90e832
33 unsigned int width, 33 unsigned int width,
34 unsigned int height, 34 unsigned int height,
35 const Orthanc::IDynamicObject* payload) 35 const Orthanc::IDynamicObject* payload)
36 { 36 {
37 // Rendering coordinates 37 // Rendering coordinates
38 float rx1 = x - box_.GetLeft(); 38 float rx1 = static_cast<float>(x - box_.GetLeft());
39 float ry1 = y - box_.GetTop(); 39 float ry1 = static_cast<float>(y - box_.GetTop());
40 float rx2 = rx1 + static_cast<float>(width); 40 float rx2 = rx1 + static_cast<float>(width);
41 float ry2 = ry1 + static_cast<float>(height); 41 float ry2 = ry1 + static_cast<float>(height);
42 42
43 // Texture coordinates 43 // Texture coordinates
44 assert(payload != NULL); 44 assert(payload != NULL);
79 79
80 80
81 OpenGLTextCoordinates::OpenGLTextCoordinates(const GlyphTextureAlphabet& alphabet, 81 OpenGLTextCoordinates::OpenGLTextCoordinates(const GlyphTextureAlphabet& alphabet,
82 const std::string& utf8) : 82 const std::string& utf8) :
83 box_(alphabet.GetAlphabet(), utf8), 83 box_(alphabet.GetAlphabet(), utf8),
84 textureWidth_(alphabet.GetTextureWidth()), 84 textureWidth_(static_cast<float>(alphabet.GetTextureWidth())),
85 textureHeight_(alphabet.GetTextureHeight()) 85 textureHeight_(static_cast<float>(alphabet.GetTextureHeight()))
86 { 86 {
87 if (textureWidth_ <= 0 || 87 if (textureWidth_ <= 0 ||
88 textureHeight_ <= 0) 88 textureHeight_ <= 0)
89 { 89 {
90 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); 90 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);