mail[Wesnoth-commits] r28326 - in /trunk/src/gui/widgets: grid.cpp helper.cpp helper.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on August 04, 2008 - 19:24:
Author: mordante
Date: Mon Aug  4 18:59:20 2008
New Revision: 28326

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28326&view=rev
Log:
Add the minus operators to tpoint.

Modified:
    trunk/src/gui/widgets/grid.cpp
    trunk/src/gui/widgets/helper.cpp
    trunk/src/gui/widgets/helper.hpp

Modified: trunk/src/gui/widgets/grid.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/grid.cpp?rev=28326&r1=28325&r2=28326&view=diff
==============================================================================
--- trunk/src/gui/widgets/grid.cpp (original)
+++ trunk/src/gui/widgets/grid.cpp Mon Aug  4 18:59:20 2008
@@ -569,11 +569,7 @@
                return border_space();
        }
 
-       //@todo Add the full set of operators to point.
-       tpoint max = maximum;
-       max.x -= border_space().x;
-       max.y -= border_space().y;
-       best_size_ =  widget_->get_best_size(max) + border_space();
+       best_size_ =  widget_->get_best_size(maximum - border_space()) + 
border_space();
 
        DBG_G << "Grid child : maximum size " 
                << maximum << " returning " << best_size_ << ".\n";

Modified: trunk/src/gui/widgets/helper.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/helper.cpp?rev=28326&r1=28325&r2=28326&view=diff
==============================================================================
--- trunk/src/gui/widgets/helper.cpp (original)
+++ trunk/src/gui/widgets/helper.cpp Mon Aug  4 18:59:20 2008
@@ -70,6 +70,13 @@
 { 
        x += point.x; 
        y += point.y;
+       return *this;
+}
+
+tpoint& tpoint::operator-=(const tpoint& point)
+{ 
+       x -= point.x; 
+       y -= point.y;
        return *this;
 }
 

Modified: trunk/src/gui/widgets/helper.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/helper.hpp?rev=28326&r1=28325&r2=28326&view=diff
==============================================================================
--- trunk/src/gui/widgets/helper.hpp (original)
+++ trunk/src/gui/widgets/helper.hpp Mon Aug  4 18:59:20 2008
@@ -59,6 +59,10 @@
 
        tpoint& operator+=(const tpoint& point);
 
+       tpoint operator-(const tpoint& point) const 
+               { return tpoint(x - point.x, y - point.y); }
+
+       tpoint& operator-=(const tpoint& point);
 };
 
 std::ostream &operator<<(std::ostream &stream, const tpoint& point);




Related Messages


Powered by MHonArc, Updated Tue Aug 05 14:01:46 2008