mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 19:47:39 +00:00
Merge pull request #88 from anthonyc-r/master
Make GSHorizontalTypesetter use defaultTabInterval if it has run out …
This commit is contained in:
commit
d28fe15d03
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…
Add table
Add a link
Reference in a new issue