Changeset 114 for trunk


Ignore:
Timestamp:
06/11/13 19:25:36 (12 years ago)
Author:
epyon
Message:
  • texture_font - fixes
  • gui_style - fixes
  • position - added missing accessors and expand/shrink
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/position.hh

    r112 r114  
    102102                void set_position( position p ) { lr = p + (lr - ul); ul = p; }
    103103
     104                position ur() const { return position( lr.x, ul.y ); }
     105                position ll() const { return position( ul.x, lr.y ); }
    104106                /**
    105107                 *Gets the dimensions of the rectangle.  Synonym for get_size.
     
    159161                 */
    160162                bool is_valid() const { return x2 >= x1 && y2 >= y1; }
     163                void expand( value_type value ) { position p(value,value); ul -= p; lr += p; }
     164                void shrink( value_type value ) { position p(value,value); ul += p; lr -= p; }
     165                rectangle expanded( int value ) { position p(value,value); return rectangle(ul-p, lr+p); }
     166                rectangle shrinked( int value ) { position p(value,value); return rectangle(ul+p, lr-p); }
    161167               
    162168                /**
  • trunk/src/gfx/texture_font.cc

    r103 r114  
    2828        m_hinting( true ), m_filtering( true ), m_rlibrary( nullptr ), m_rface( nullptr )
    2929{
     30        load_freetype_library();
    3031        size_t hres = 64;
    3132        FT_Error error;
  • trunk/src/gui/gui_style.cc

    r104 r114  
    7474        // check id
    7575        lua_getfield( m_lua, -1, cid );
    76         if ( !lua_istable( m_lua, -1 ) )
     76        if ( lua_istable( m_lua, -1 ) )
    7777        {
    7878                lua_getfield( m_lua, -1, centry );
     
    8383        // check class
    8484        lua_getfield( m_lua, -1, cclass );
    85         if ( !lua_istable( m_lua, -1 ) )
     85        if ( lua_istable( m_lua, -1 ) )
    8686        {
    8787                lua_getfield( m_lua, -1, centry );
     
    9191
    9292        // check entry
    93         lua_getfield( m_lua, -1, cclass );
     93        lua_getfield( m_lua, -1, centry );
    9494        if ( lua_type( m_lua, -1 ) == type ) return true;
    9595        return false;
Note: See TracChangeset for help on using the changeset viewer.