Commit e03ff5e7 authored by cutealien's avatar cutealien

Add dimension2d::operator- for completeness.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3325 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9e10006a
...@@ -35,7 +35,7 @@ namespace core ...@@ -35,7 +35,7 @@ namespace core
template <class U> template <class U>
dimension2d<T>& operator=(const dimension2d<U>& other) dimension2d<T>& operator=(const dimension2d<U>& other)
{ {
Width = (T) other.Width; Width = (T) other.Width;
Height = (T) other.Height; Height = (T) other.Height;
return *this; return *this;
...@@ -106,6 +106,12 @@ namespace core ...@@ -106,6 +106,12 @@ namespace core
return *this; return *this;
} }
//! Add two dimensions
dimension2d<T> operator+(const dimension2d<T>& other) const
{
return dimension2d<T>(Width+other.Width, Height+other.Height);
}
//! Subtract a dimension from this one //! Subtract a dimension from this one
dimension2d<T>& operator-=(const dimension2d<T>& other) dimension2d<T>& operator-=(const dimension2d<T>& other)
{ {
...@@ -114,11 +120,10 @@ namespace core ...@@ -114,11 +120,10 @@ namespace core
return *this; return *this;
} }
//! Subtract one dimension from another
//! Add two dimensions dimension2d<T> operator-(const dimension2d<T>& other) const
dimension2d<T> operator+(const dimension2d<T>& other) const
{ {
return dimension2d<T>(Width+other.Width, Height+other.Height); return dimension2d<T>(Width-other.Width, Height-other.Height);
} }
//! Get area //! Get area
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment