[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] master e658c65 10/13: [ftinspect] Mark float literals
From: |
Werner LEMBERG |
Subject: |
[freetype2-demos] master e658c65 10/13: [ftinspect] Mark float literals as float. |
Date: |
Thu, 11 May 2017 15:26:24 -0400 (EDT) |
branch: master
commit e658c6548be03ee1496ddd2991d527a0701ae69c
Author: Philipp Kerling <address@hidden>
Commit: Werner Lemberg <address@hidden>
[ftinspect] Mark float literals as float.
* src/ftinspect.cpp (GlyphPointNumbers::paint): Do it.
---
ChangeLog | 6 ++++++
src/ftinspect.cpp | 16 ++++++++--------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2bd37ca..90928e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2017-05-11 Philipp Kerling <address@hidden>
+ [ftinspect] Mark float literals as float.
+
+ * src/ftinspect.cpp (GlyphPointNumbers::paint): Do it.
+
+2017-05-11 Philipp Kerling <address@hidden>
+
[ftinspect] Insert explicit casts where warranted.
This avoids compiler warnings.
diff --git a/src/ftinspect.cpp b/src/ftinspect.cpp
index 0a80242..ec05649 100644
--- a/src/ftinspect.cpp
+++ b/src/ftinspect.cpp
@@ -1016,13 +1016,13 @@ GlyphPointNumbers::paint(QPainter* painter,
char* tags = outline->tags;
QVector2D octants[8] = { QVector2D(1, 0),
- QVector2D(0.707, -0.707),
+ QVector2D(0.707f, -0.707f),
QVector2D(0, -1),
- QVector2D(-0.707, -0.707),
+ QVector2D(-0.707f, -0.707f),
QVector2D(-1, 0),
- QVector2D(-0.707, 0.707),
+ QVector2D(-0.707f, 0.707f),
QVector2D(0, 1),
- QVector2D(0.707, 0.707) };
+ QVector2D(0.707f, 0.707f) };
int ptIdx = 0;
@@ -1071,16 +1071,16 @@ GlyphPointNumbers::paint(QPainter* painter,
QVector2D middle = in + out;
// check whether vector is very small, using a threshold of 1/8px
- if (qAbs(middle.x()) < 1.0 / 8
- && qAbs(middle.y()) < 1.0 / 8)
+ if (qAbs(middle.x()) < 1.0f / 8
+ && qAbs(middle.y()) < 1.0f / 8)
{
// in case of vectors in almost exactly opposite directions,
// use a vector orthogonal to them
middle.setX(out.y());
middle.setY(-out.x());
- if (qAbs(middle.x()) < 1.0 / 8
- && qAbs(middle.y()) < 1.0 / 8)
+ if (qAbs(middle.x()) < 1.0f / 8
+ && qAbs(middle.y()) < 1.0f / 8)
{
// use direction based on point index for the offset
// if we still don't have a good value
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] master e658c65 10/13: [ftinspect] Mark float literals as float.,
Werner LEMBERG <=