summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-03-22 03:37:01 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-03-22 03:37:18 +0100
commit543ccb3c5a992dafddb9094481083814c3e342cd (patch)
tree1129fec395de60378ee1b702e6137a75de1c4d68
parentef9f0f7a29b0e11646030e1a8455740e442f0def (diff)
[COVERITY] pose-widget: fix integer math where fpu was meant
-rw-r--r--pose-widget/glwidget.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/pose-widget/glwidget.cpp b/pose-widget/glwidget.cpp
index de5a139b..17f4e1a2 100644
--- a/pose-widget/glwidget.cpp
+++ b/pose-widget/glwidget.cpp
@@ -139,10 +139,10 @@ void GLWidget::project_quad_texture()
const vec3 dst_corners[] =
{
- vec3(-sx_/2. * c, -sy_/2, 0),
- vec3(sx_/2 * c, -sy_/2, 0),
- vec3(-sx_/2 * c, sy_/2, 0),
- vec3(sx_/2 * c, sy_/2, 0.)
+ vec3(-sx_/2. * c, -sy_/2., 0),
+ vec3(sx_/2. * c, -sy_/2., 0),
+ vec3(-sx_/2. * c, sy_/2., 0),
+ vec3(sx_/2. * c, sy_/2., 0.)
};
for (int i = 0; i < 4; i++)
@@ -272,7 +272,7 @@ vec2 GLWidget::project(const vec3 &point)
{
vec3 ret = rotation * point;
num z = std::max<num>(.75f, 1 + translation.z()/-60);
- int w = width(), h = height();
+ num w = width(), h = height();
num x = w * translation.x() / 2 / -40;
if (std::abs(x) > w/2)
x = x > 0 ? w/2 : w/-2;