~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libcore/rect.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sindhudweep Narayan Sarkar
  • Date: 2009-10-07 00:06:10 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20091007000610-mj9rwqe774gizn1j
Tags: 0.8.6-0ubuntu1
new upstream release 0.8.6 (LP: #435897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "log.h"
20
20
#include "SWFStream.h"
21
21
#include "SWFMatrix.h"
22
 
#include "utility.h" // for flerp, clamp...
 
22
#include "GnashNumeric.h" // for flerp, clamp...
23
23
 
24
24
#include <sstream> // for ::print and ::toString
25
25
 
26
26
namespace gnash {
27
27
 
28
 
void    rect::read(SWFStream& in)
 
28
void rect::read(SWFStream& in)
29
29
{
30
30
    in.align();
31
31
    in.ensureBits(5);
104
104
    expand_to(p3.x, p3.y);
105
105
}
106
106
 
107
 
void  rect::expand_to_rect(const rect& r) 
 
107
void
 
108
rect::expand_to_rect(const rect& r) 
108
109
// Expand ourself to enclose the given rect.
109
110
{    
110
111
    if( r.is_null() ) {
121
122
    }
122
123
}   
123
124
 
124
 
void    rect::expand_to_transformed_rect(const SWFMatrix& m, const rect& r)
 
125
void
 
126
rect::expand_to_transformed_rect(const SWFMatrix& m, const rect& r)
125
127
// Expand ourself to a transformed rect.
126
128
{   
127
129
    if ( r.is_null() )
160
162
    assert( !a.is_null() );
161
163
    assert( !b.is_null() );
162
164
    
163
 
    using utility::flerp;   
164
165
    _xMin = (boost::int32_t)(flerp(a.get_x_min(), b.get_x_min(), t));
165
166
    _yMin = (boost::int32_t)(flerp(a.get_y_min(), b.get_y_min(), t));
166
167
    _xMax = (boost::int32_t)(flerp(a.get_x_max(), b.get_x_max(), t));
171
172
rect::clamp(point& p) const
172
173
{
173
174
    assert( !is_null() );
174
 
    p.x = utility::clamp<boost::int32_t>(p.x, _xMin, _xMax);
175
 
    p.y = utility::clamp<boost::int32_t>(p.y, _yMin, _yMax);
 
175
    p.x = gnash::clamp<boost::int32_t>(p.x, _xMin, _xMax);
 
176
    p.y = gnash::clamp<boost::int32_t>(p.y, _yMin, _yMax);
176
177
}
177
178
 
178
179
std::string