mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 23:30:48 +00:00
* Source/GSHorizontalTypesetter.m: Change floats into CGFloats to
stop infinite loop. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36282 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
36a6d1ca32
commit
a0616ff819
2 changed files with 23 additions and 18 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2013-03-05 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/GSHorizontalTypesetter.m: Change floats into CGFloats to
|
||||||
|
stop infinite loop.
|
||||||
|
|
||||||
2013-03-04 Fred Kiefer <FredKiefer@gmx.de>
|
2013-03-04 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* configure.ac: Use CPPFLAGS instead of CFLAGS for libpng.
|
* configure.ac: Use CPPFLAGS instead of CFLAGS for libpng.
|
||||||
|
|
|
@ -315,7 +315,7 @@ including gi will have been cached.
|
||||||
struct GSHorizontalTypesetter_line_frag_s
|
struct GSHorizontalTypesetter_line_frag_s
|
||||||
{
|
{
|
||||||
NSRect rect;
|
NSRect rect;
|
||||||
float last_used;
|
CGFloat last_used;
|
||||||
unsigned int last_glyph; /* last_glyph+1, actually */
|
unsigned int last_glyph; /* last_glyph+1, actually */
|
||||||
};
|
};
|
||||||
typedef struct GSHorizontalTypesetter_line_frag_s line_frag_t;
|
typedef struct GSHorizontalTypesetter_line_frag_s line_frag_t;
|
||||||
|
@ -329,7 +329,7 @@ For bigger values the width gets ignored.
|
||||||
-(void) fullJustifyLine: (line_frag_t *)lf : (int)num_line_frags
|
-(void) fullJustifyLine: (line_frag_t *)lf : (int)num_line_frags
|
||||||
{
|
{
|
||||||
unsigned int i, start;
|
unsigned int i, start;
|
||||||
float extra_space, delta;
|
CGFloat extra_space, delta;
|
||||||
unsigned int num_spaces;
|
unsigned int num_spaces;
|
||||||
NSString *str = [curTextStorage string];
|
NSString *str = [curTextStorage string];
|
||||||
glyph_cache_t *g;
|
glyph_cache_t *g;
|
||||||
|
@ -375,7 +375,7 @@ For bigger values the width gets ignored.
|
||||||
-(void) rightAlignLine: (line_frag_t *)lf : (int)num_line_frags
|
-(void) rightAlignLine: (line_frag_t *)lf : (int)num_line_frags
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
float delta;
|
CGFloat delta;
|
||||||
glyph_cache_t *g;
|
glyph_cache_t *g;
|
||||||
|
|
||||||
if (lf->rect.size.width >= LARGE_SIZE)
|
if (lf->rect.size.width >= LARGE_SIZE)
|
||||||
|
@ -395,7 +395,7 @@ For bigger values the width gets ignored.
|
||||||
-(void) centerAlignLine: (line_frag_t *)lf : (int)num_line_frags
|
-(void) centerAlignLine: (line_frag_t *)lf : (int)num_line_frags
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
float delta;
|
CGFloat delta;
|
||||||
glyph_cache_t *g;
|
glyph_cache_t *g;
|
||||||
|
|
||||||
if (lf->rect.size.width >= LARGE_SIZE)
|
if (lf->rect.size.width >= LARGE_SIZE)
|
||||||
|
@ -422,7 +422,7 @@ For bigger values the width gets ignored.
|
||||||
NSSize shift;
|
NSSize shift;
|
||||||
int i;
|
int i;
|
||||||
unsigned int g, g2, first;
|
unsigned int g, g2, first;
|
||||||
float container_height;
|
CGFloat container_height;
|
||||||
/*
|
/*
|
||||||
Ask the layout manager for soft-invalidated layout for the current
|
Ask the layout manager for soft-invalidated layout for the current
|
||||||
glyph. If there is a set of line frags starting at the current glyph,
|
glyph. If there is a set of line frags starting at the current glyph,
|
||||||
|
@ -479,10 +479,10 @@ For bigger values the width gets ignored.
|
||||||
|
|
||||||
|
|
||||||
- (NSRect)_getProposedRectFor: (BOOL)newParagraph
|
- (NSRect)_getProposedRectFor: (BOOL)newParagraph
|
||||||
withLineHeight: (float) line_height
|
withLineHeight: (CGFloat) line_height
|
||||||
{
|
{
|
||||||
float hindent;
|
CGFloat hindent;
|
||||||
float tindent = [curParagraphStyle tailIndent];
|
CGFloat tindent = [curParagraphStyle tailIndent];
|
||||||
|
|
||||||
if (newParagraph)
|
if (newParagraph)
|
||||||
hindent = [curParagraphStyle firstLineHeadIndent];
|
hindent = [curParagraphStyle firstLineHeadIndent];
|
||||||
|
@ -522,11 +522,11 @@ Return values 0, 1, 2 are mostly the same as from
|
||||||
NSRect rect, remain;
|
NSRect rect, remain;
|
||||||
|
|
||||||
/* Baseline and line height handling. */
|
/* Baseline and line height handling. */
|
||||||
float line_height; /* Current line height. */
|
CGFloat line_height; /* Current line height. */
|
||||||
float max_line_height; /* Maximum line height (usually from the paragraph style). */
|
CGFloat max_line_height; /* Maximum line height (usually from the paragraph style). */
|
||||||
float baseline; /* Baseline position (0 is top of line-height, positive is down). */
|
CGFloat baseline; /* Baseline position (0 is top of line-height, positive is down). */
|
||||||
float ascender; /* Amount of space we want above the baseline (always>=0). */
|
CGFloat ascender; /* Amount of space we want above the baseline (always>=0). */
|
||||||
float descender; /* Amount of space we want below the baseline (always>=0). */
|
CGFloat descender; /* Amount of space we want below the baseline (always>=0). */
|
||||||
/*
|
/*
|
||||||
These are values for the line as a whole. We start out by initializing
|
These are values for the line as a whole. We start out by initializing
|
||||||
for the first glyph on the line and then update these as we add more
|
for the first glyph on the line and then update these as we add more
|
||||||
|
@ -603,7 +603,7 @@ Return values 0, 1, 2 are mostly the same as from
|
||||||
|
|
||||||
/* Set up our initial baseline info. */
|
/* Set up our initial baseline info. */
|
||||||
{
|
{
|
||||||
float min = [curParagraphStyle minimumLineHeight];
|
CGFloat min = [curParagraphStyle minimumLineHeight];
|
||||||
max_line_height = [curParagraphStyle maximumLineHeight];
|
max_line_height = [curParagraphStyle maximumLineHeight];
|
||||||
|
|
||||||
/* sanity */
|
/* sanity */
|
||||||
|
@ -640,7 +640,7 @@ Return values 0, 1, 2 are mostly the same as from
|
||||||
|
|
||||||
#define WANT_LINE_HEIGHT(h) \
|
#define WANT_LINE_HEIGHT(h) \
|
||||||
do { \
|
do { \
|
||||||
float __new_height = (h); \
|
CGFloat __new_height = (h); \
|
||||||
if (max_line_height > 0 && __new_height > max_line_height) \
|
if (max_line_height > 0 && __new_height > max_line_height) \
|
||||||
__new_height = max_line_height; \
|
__new_height = max_line_height; \
|
||||||
if (__new_height > line_height) \
|
if (__new_height > line_height) \
|
||||||
|
@ -706,7 +706,7 @@ restart: ;
|
||||||
|
|
||||||
NSFont *f = cache->font;
|
NSFont *f = cache->font;
|
||||||
|
|
||||||
float f_ascender = [f ascender], f_descender = -[f descender];
|
CGFloat f_ascender = [f ascender], f_descender = -[f descender];
|
||||||
|
|
||||||
NSGlyph last_glyph = NSNullGlyph;
|
NSGlyph last_glyph = NSNullGlyph;
|
||||||
NSPoint last_p;
|
NSPoint last_p;
|
||||||
|
@ -781,7 +781,7 @@ restart: ;
|
||||||
(TODO?) */
|
(TODO?) */
|
||||||
if (g->font != f)
|
if (g->font != f)
|
||||||
{
|
{
|
||||||
float new_height;
|
CGFloat new_height;
|
||||||
f = g->font;
|
f = g->font;
|
||||||
f_ascender = [f ascender];
|
f_ascender = [f ascender];
|
||||||
f_descender = -[f descender];
|
f_descender = -[f descender];
|
||||||
|
@ -887,7 +887,7 @@ restart: ;
|
||||||
|
|
||||||
/* Baseline adjustments. */
|
/* Baseline adjustments. */
|
||||||
{
|
{
|
||||||
float y = 0;
|
CGFloat y = 0;
|
||||||
|
|
||||||
/* Attributes are up-side-down in our coordinate system. */
|
/* Attributes are up-side-down in our coordinate system. */
|
||||||
if (g->attributes.superscript)
|
if (g->attributes.superscript)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue