Changeset 172 for trunk/nv/position.hh


Ignore:
Timestamp:
07/25/13 14:37:24 (12 years ago)
Author:
epyon
Message:
  • sdl - missing 2.0 sdl_functions
  • lua - compat implementation of lua_upvalueindex
  • position - rectangle single argument constructor made explicit
  • gl_window - fix for SDL 2.0 ascii code of key press
  • lua/glm - coord as a separate class (behaves like ivec2)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/position.hh

    r132 r172  
    4141                 * @param p The position to assign the rectangle to.
    4242                 */
    43                 rectangle( position p ) : ul(p), lr(p) {}
     43                explicit rectangle( position p ) : ul(p), lr(p) {}
    4444               
    4545                /**
     
    152152
    153153                /**
     154                 * Gets the area of the rectangle.
     155                 *
     156                 * @returns The area of the rectangle, including the edge
     157                 */
     158                value_type get_enclosed_area() const { return (lr.y - ul.y + 1) * (lr.x - ul.x + 1); }
     159
     160                /**
    154161                 * Checks to see if the rectangle is backwards.
    155162                 *
Note: See TracChangeset for help on using the changeset viewer.