Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
32ad8ed2
Commit
32ad8ed2
authored
Mar 11, 2014
by
Mark Morschhäuser
Browse files
Fixed MSVC++ compile error due to sqrt() usage.
parent
80da61dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/arrowitem.cpp
View file @
32ad8ed2
...
...
@@ -66,7 +66,7 @@ void ArrowItem::updatePath(const QPointF &endPoint)
{
const
double
arrowWidth
=
15.0
;
const
double
headWidth
=
40.0
;
const
double
headLength
=
headWidth
/
sqrt
(
2
)
;
const
double
headLength
=
headWidth
/
pow
(
2
,
0.5
);
// aka headWidth /
sqrt
(2)
but this produces a compile error with MSVC++
const
double
phi
=
15
;
if
(
!
startItem
)
...
...
cockatrice/src/playertarget.cpp
View file @
32ad8ed2
...
...
@@ -90,7 +90,8 @@ void PlayerTarget::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*o
cachedPixmap
=
QPixmap
(
translatedSize
.
width
(),
translatedSize
.
height
());
QPainter
tempPainter
(
&
cachedPixmap
);
QRadialGradient
grad
(
translatedRect
.
center
(),
sqrt
(
translatedSize
.
width
()
*
translatedSize
.
width
()
+
translatedSize
.
height
()
*
translatedSize
.
height
())
/
2
);
// pow(foo, 0.5) equals to sqrt(foo), but using sqrt(foo) in this context will produce a compile error with MSVC++
QRadialGradient
grad
(
translatedRect
.
center
(),
pow
(
translatedSize
.
width
()
*
translatedSize
.
width
()
+
translatedSize
.
height
()
*
translatedSize
.
height
(),
0.5
)
/
2
);
grad
.
setColorAt
(
1
,
Qt
::
black
);
grad
.
setColorAt
(
0
,
QColor
(
180
,
180
,
180
));
tempPainter
.
fillRect
(
QRectF
(
0
,
0
,
translatedSize
.
width
(),
translatedSize
.
height
()),
grad
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment