mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Make GSHorizontalTypesetter use defaultTabInterval if it has run out of defined tabstops
This commit is contained in:
parent
2858654976
commit
186f2da812
1 changed files with 9 additions and 5 deletions
|
@ -870,6 +870,11 @@ restart: ;
|
|||
*/
|
||||
NSArray *tabs = [curParagraphStyle tabStops];
|
||||
NSTextTab *tab = nil;
|
||||
float defaultInterval = [curParagraphStyle defaultTabInterval];
|
||||
/* Set it to something reasonable if unset */
|
||||
if (defaultInterval == 0.0) {
|
||||
defaultInterval = 100.0;
|
||||
}
|
||||
int i, c = [tabs count];
|
||||
/* Find first tab beyond our current position. */
|
||||
for (i = 0; i < c; i++)
|
||||
|
@ -888,12 +893,11 @@ restart: ;
|
|||
}
|
||||
if (i == c)
|
||||
{
|
||||
/* TODO: we're already past all the tab stops. what
|
||||
should we do?
|
||||
|
||||
Pretend that we have tabs every 100 points.
|
||||
/*
|
||||
Tabs after the last value in tabStops should use the
|
||||
defaultTabInterval provided by NSParagraphStyle.
|
||||
*/
|
||||
p.x = (floor(p.x / 100.0) + 1.0) * 100.0;
|
||||
p.x = (floor(p.x / defaultInterval) + 1.0) * defaultInterval;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue