mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:10:48 +00:00
Added missing method [isValidGlyphIndex:].
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17749 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e786dfcf87
commit
3480b30e56
2 changed files with 17 additions and 0 deletions
|
@ -186,6 +186,9 @@ to NO. */
|
|||
- (NSGlyph) glyphAtIndex: (unsigned int)glyphIndex
|
||||
isValidIndex: (BOOL *)isValidIndex;
|
||||
|
||||
/* Returns if the glyph at glyphIndex is valid or not */
|
||||
- (BOOL) isValidGlyphIndex: (unsigned int)glyphIndex;
|
||||
|
||||
/* Copies displayed glyphs to glyphArray for glyphRange. Returns the number
|
||||
of glyphs actually copied to the array. NSRangeException of the range is
|
||||
invalid (extends beyond the end of glyphs). */
|
||||
|
|
|
@ -719,6 +719,20 @@ not completely accurate).
|
|||
return r->glyphs[glyphIndex].g;
|
||||
}
|
||||
|
||||
- (BOOL) isValidGlyphIndex: (unsigned int)glyphIndex
|
||||
{
|
||||
if (glyphIndex == (unsigned int)-1)
|
||||
return NO;
|
||||
|
||||
if (glyphs->glyph_length <= glyphIndex)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (unsigned int) getGlyphs: (NSGlyph *)glyphArray
|
||||
range: (NSRange)glyphRange
|
||||
|
|
Loading…
Reference in a new issue