projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b641d01
)
Added conversion from and to Vector to Sizef
author
Ingo Ruhnke
<grumbel@gmail.com>
Sat, 16 Aug 2014 19:49:12 +0000
(21:49 +0200)
committer
Ingo Ruhnke
<grumbel@gmail.com>
Sat, 16 Aug 2014 19:49:12 +0000
(21:49 +0200)
src/math/sizef.hpp
patch
|
blob
|
history
diff --git
a/src/math/sizef.hpp
b/src/math/sizef.hpp
index
636416a
..
893d0d4
100644
(file)
--- a/
src/math/sizef.hpp
+++ b/
src/math/sizef.hpp
@@
-19,6
+19,8
@@
#include <iosfwd>
+#include "math/vector.hpp"
+
class Size;
class Sizef
@@
-29,6
+31,11
@@
public:
height(0.0f)
{}
+ Sizef(const Vector& v) :
+ width(v.x),
+ height(v.y)
+ {}
+
Sizef(float width_, float height_) :
width(width_),
height(height_)
@@
-69,6
+76,11
@@
public:
return *this;
}
+ Vector as_vector() const
+ {
+ return Vector(width, height);
+ }
+
public:
float width;
float height;