Author: mlytwyn Date: Thu Dec 22 20:13:26 2016 New Revision: 40277 URL: http://svn.gna.org/viewcvs/gnustep?rev=40277&view=rev Log: Merge GSLayoutManager.m with GUI trunk revision 40273
Modified: libs/gui/branches/gnustep_testplant_branch/Source/GSLayoutManager.m Modified: libs/gui/branches/gnustep_testplant_branch/Source/GSLayoutManager.m URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/GSLayoutManager.m?rev=40277&r1=40276&r2=40277&view=diff ============================================================================== --- libs/gui/branches/gnustep_testplant_branch/Source/GSLayoutManager.m (original) +++ libs/gui/branches/gnustep_testplant_branch/Source/GSLayoutManager.m Thu Dec 22 20:13:26 2016 @@ -984,43 +984,6 @@ } return cpos + r->glyphs[glyphIndex - pos].char_offset; -} - -/** - * GNUstep extension - */ -- (NSSize) advancementForGlyphAtIndex: (unsigned int)glyphIndex -{ - glyph_run_t *r; - unsigned int pos, cpos; - - if (glyphs->glyph_length <= glyphIndex) - { - [self _generateGlyphsUpToGlyph: glyphIndex]; - if (glyphs->glyph_length <= glyphIndex) - { - [NSException raise: NSRangeException - format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; - return NSMakeSize(0,0); - } - } - - r = run_for_glyph_index(glyphIndex, glyphs, &pos, &cpos); - if (!r) - { - [NSException raise: NSRangeException - format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; - return NSMakeSize(0,0); - } - - if (r->head.glyph_length <= glyphIndex - pos) - { - [NSException raise: NSRangeException - format: @"%s internal error!", __PRETTY_FUNCTION__]; - return NSMakeSize(0,0); - } - - return r->glyphs[glyphIndex - pos].advancement; } - (NSRange) characterRangeForGlyphRange: (NSRange)glyphRange @@ -1677,6 +1640,15 @@ if (range) *range = NSMakeRange(pos, r->head.glyph_length); return r->font; +} + +/** + * GNUstep extension + */ +- (NSSize) advancementForGlyphAtIndex: (unsigned int)idx +{ + GET_GLYPH + return r->glyphs[idx].advancement; } - (void) insertGlyph: (NSGlyph)aGlyph @@ -3253,7 +3225,14 @@ for (i=0; i<length; i++) { - advances[i] = [run->font advancementForGlyph: glyph_list[i]]; + if ((glyph_list[i] != NSControlGlyph) && (glyph_list[i] != GSAttachmentGlyph)) + { + advances[i] = [run->font advancementForGlyph: glyph_list[i]]; + } + else + { + advances[i] = NSZeroSize; + } } [self insertGlyphs: glyph_list _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs