Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 24, 2018, 4:58:39 PM (7 years ago)
Author:
landauf
Message:

added work around for a bug in cegui 0.8 (the cegui lua scripts expect a "Font*" pointer to call getTextExtent(), but cegui 0.8 only returns "const Font*")

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/GUITools.lua

    r11799 r11809  
    3131
    3232    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
    33     local height = window:getFont():getLineSpacing() + window:getUnclippedOuterRect():get():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()
    34     local width =  window:getFont():getTextExtent(window:getText()) + window:getUnclippedOuterRect():get():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth()
     33
     34    local lineSpacing = window:getFont():getLineSpacing()
     35    --local textExtent = window:getFont():getTextExtent(window:getText())
     36    local textExtent = orxonox.GUIManager:getFontTextExtent(window:getFont(), window:getText()) -- workaround for bug in cegui lua scripts
     37   
     38    local height = lineSpacing + window:getUnclippedOuterRect():get():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()
     39    local width  = textExtent  + window:getUnclippedOuterRect():get():getWidth()  - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth()
    3540
    3641    table.insert(size, height)
Note: See TracChangeset for help on using the changeset viewer.