mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:57:39 +00:00
Added workaround to clip string in rect
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7438 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c7d86ddccb
commit
28830d2c30
1 changed files with 9 additions and 0 deletions
|
@ -1241,6 +1241,12 @@ setupLine(GSTextLine *line, NSAttributedString *str, NSRange range,
|
|||
NSPoint point;
|
||||
NSView *view = [NSView focusView];
|
||||
|
||||
/* FIXME: This is an extremely lossy and temporary workaround for
|
||||
the fact that we should draw only inside rect. */
|
||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||
DPSgsave(ctxt);
|
||||
NSRectClip (rect);
|
||||
|
||||
/*
|
||||
* Since [-drawAtPoint:] positions the top-left corner of the text at
|
||||
* the point, we locate the top-left corner of the rectangle to do the
|
||||
|
@ -1253,6 +1259,9 @@ setupLine(GSTextLine *line, NSAttributedString *str, NSRange range,
|
|||
point.y = rect.origin.y + rect.size.height;
|
||||
|
||||
[self drawAtPoint: point];
|
||||
|
||||
/* Restore matching the DPSgsave used in the temporary workaround */
|
||||
DPSgrestore(ctxt);
|
||||
}
|
||||
|
||||
- (NSSize) size
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue