~ubuntu-branches/ubuntu/trusty/plee-the-bear/trusty-proposed

« back to all changes in this revision

Viewing changes to bear-engine/core/src/visual/code/scene_element.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Julien Jorge, Julien Jorge
  • Date: 2010-11-17 20:13:34 UTC
  • mfrom: (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101117201334-o4dp7uq437to7oxb
Tags: 0.5.1-1
[ Julien Jorge ]
* New upstream release (Closes: #565062, #546514).
* Add armhf architecture (Closes: #604689).
* Remove patches integrated upstream: rpath-editors.diff, rpath-game.diff,
  editors-menu-section.diff.
* Bump the Standard-Version, no changes.
* Update my email address.
* Set build dependency of libclaw to 1.6.0.
* Add the missing ${misc:Depends} in debian/control.
* List gettext translations in bear-factory.install and plee-the-bear.install.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
  Bear Engine
3
3
 
4
 
  Copyright (C) 2005-2009 Julien Jorge, Sebastien Angibaud
 
4
  Copyright (C) 2005-2010 Julien Jorge, Sebastien Angibaud
5
5
 
6
6
  This program is free software; you can redistribute it and/or modify it
7
7
  under the terms of the GNU General Public License as published by the
77
77
 
78
78
/*----------------------------------------------------------------------------*/
79
79
/**
80
 
 * \brief Get a rectangle where the element is completely opaque.
 
80
 * \brief Get a rectangle where the element is fully opaque.
81
81
 */
82
82
bear::visual::rectangle_type bear::visual::scene_element::get_opaque_box() const
83
83
{
170
170
 
171
171
/*----------------------------------------------------------------------------*/
172
172
/**
 
173
 * \brief Set the factor applied to the element when rendered.
 
174
 * \param r The factor on both axis.
 
175
 */
 
176
void bear::visual::scene_element::set_scale_factor( double r )
 
177
{
 
178
  m_elem->set_scale_factor(r, r);
 
179
} // scene_element::set_scale_factor()
 
180
 
 
181
/*----------------------------------------------------------------------------*/
 
182
/**
173
183
 * \brief Get the factor applied on the x-axis to the element when rendered.
174
184
 */
175
185
double bear::visual::scene_element::get_scale_factor_x() const
188
198
 
189
199
/*----------------------------------------------------------------------------*/
190
200
/**
 
201
 * \brief Get the width of the element (before the scaling factor).
 
202
 */
 
203
bear::visual::size_type bear::visual::scene_element::get_element_width() const
 
204
{
 
205
  if ( get_scale_factor_x() == 0 )
 
206
    return get_bounding_box().width();
 
207
  else
 
208
    return get_bounding_box().width() / get_scale_factor_x();
 
209
} // scene_element::get_element_width()
 
210
 
 
211
/*----------------------------------------------------------------------------*/
 
212
/**
 
213
 * \brief Get the height of the element (before the scaling factor).
 
214
 */
 
215
bear::visual::size_type bear::visual::scene_element::get_element_height() const
 
216
{
 
217
  if ( get_scale_factor_y() == 0 )
 
218
    return get_bounding_box().height();
 
219
  else
 
220
    return get_bounding_box().height() / get_scale_factor_y();
 
221
} // scene_element::get_element_height()
 
222
 
 
223
/*----------------------------------------------------------------------------*/
 
224
/**
 
225
 * \brief Get the width of the element (with the scaling factor).
 
226
 */
 
227
bear::visual::size_type bear::visual::scene_element::get_width() const
 
228
{
 
229
  return get_bounding_box().width();
 
230
} // scene_element::get_width()
 
231
 
 
232
/*----------------------------------------------------------------------------*/
 
233
/**
 
234
 * \brief Get the height of the element (with the scaling factor).
 
235
 */
 
236
bear::visual::size_type bear::visual::scene_element::get_height() const
 
237
{
 
238
  return get_bounding_box().height();
 
239
} // scene_element::get_height()
 
240
 
 
241
/*----------------------------------------------------------------------------*/
 
242
/**
191
243
 * \brief Set the attributes applied to the element when rendering.
192
244
 * \param a The attributes.
193
245
 */