mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 20:01:56 +00:00
Fix initial cursor insertion location with paragraph alignment setting
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38228 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fd815172ac
commit
3f1b7cb970
1 changed files with 64 additions and 51 deletions
|
@ -884,6 +884,8 @@ has the same y origin and height as the line frag rect it is in.
|
|||
if (glyph_index == (unsigned int)-1)
|
||||
{ /* No information is available. Get default font height. */
|
||||
NSFont *f = [_typingAttributes objectForKey:NSFontAttributeName];
|
||||
NSParagraphStyle *paragraph = [_typingAttributes objectForKey: NSParagraphStyleAttributeName];
|
||||
NSTextAlignment alignment = [paragraph alignment];
|
||||
|
||||
/* will be -1 if there are no text containers */
|
||||
*textContainer = num_textcontainers - 1;
|
||||
|
@ -893,6 +895,17 @@ has the same y origin and height as the line frag rect it is in.
|
|||
tc = textcontainers + num_textcontainers - 1;
|
||||
r.origin.x += [tc->textContainer lineFragmentPadding];
|
||||
}
|
||||
|
||||
// Apply left/right/center justification...
|
||||
if (alignment == NSRightTextAlignment)
|
||||
{
|
||||
r.origin.x += [[self firstTextView] frame].size.width;
|
||||
}
|
||||
else if (alignment == NSCenterTextAlignment)
|
||||
{
|
||||
r.origin.x += [[self firstTextView] frame].size.width / 2;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
fraction_through = 1.0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue