CEGUI::Font has non-const accessors

Create issue
Issue #199 resolved
Former user created an issue

Automatic migration. Original reporter: "mat007"

The CEGUI::Font class has several methods which should probably be made const : getTextExtent getCharAtPixel (both) getFormattedLineCount getFormattedTextExtent

Reproducibility: always

Comments (3)

  1. Paul Turner

    Yeah, you're right; these should really be const.

    This fix will be made in the trunk for release as 0.7.0, as I'm trying not to break the ABI on the core libs between 0.6.0 and 0.6.1.

  2. Paul Turner

    Mainly as a note to self: While these appear to be fairly simple 'getter' functions, they are non-const due to the fact they actually perform state changing operations on the Font object (mostly due to the as-needed generation of information regarding glyphs).

    The solution is not as easy as simply adding the const specifier to the function signatures, and having half the Font internal state marked as mutable is not particularly appealing either.

    The third option is..?

  3. Paul Turner

    trunk @ rev. 2096.

    After other refactoring work some of the affected functions were removed, the work and 'mutable' use to get the remaining accessors 'const' was actually minimal.

  4. Log in to comment