[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSStringDrawing Bug correction (was Bug with NSTextAttachment ?)
From: |
Nicolas Roard |
Subject: |
NSStringDrawing Bug correction (was Bug with NSTextAttachment ?) |
Date: |
Fri, 26 Jul 2002 00:11:51 +0100 |
On 2002-07-23 19:23:19 +0100 Nicolas Roard <nicolas@witbe.net> wrote:
Hello,
I want to use and attachment in a NSMutableAttributedString; it's working, but
if I try to center
this attributed string in a NSTextView, it doesn't works well;
(...)
In the text view, the attachment cell is visible, but not rightly centered; it
starts from
the center of the textview, so it's too much on the right, like if the size of
the attachment
wasn't considered. As [AS size].width return 0 I think it's perhaps a bug ?
Well I looked in NSStringDrawing.m and it seems that the width of the chunk
in case of an Attachment isn't setted ... I just set it and now the centering
of my attachments works well.
Here is the patch :
--- NSStringDrawing.m Fri Jul 26 01:01:46 2002
+++ NSStringDrawing.m-nico Fri Jul 26 01:01:31 2002
@@ -286,6 +286,7 @@
run->baseline = [run->cell cellBaselineOffset].y;
run->height = run->glyphs[0].adv.height;
+ run->width = run->glyphs[0].adv.width;
// Unset the normale fields
run->font = nil;
run->bg = nil;
--
Nicolas Roard <nicolas@roard.com>
http://info.xdev.org/projets/gsftp
entia non sun multiplicanda praeter necessitatem -- Guillaume d'Ockham
- Bug with NSTextAttachment ?, Nicolas Roard, 2002/07/23
- NSStringDrawing Bug correction (was Bug with NSTextAttachment ?),
Nicolas Roard <=
- Status of the GNU 3DKit, Philippe C.D. Robert, 2002/07/26
- Re: Status of the GNU 3DKit, Pete French, 2002/07/26
- Re: Status of the GNU 3DKit, Philippe C.D. Robert, 2002/07/26
- Re: Status of the GNU 3DKit, Pete French, 2002/07/26
- Re: Status of the GNU 3DKit, Philippe C.D. Robert, 2002/07/26
- Re: Status of the GNU 3DKit, Pete French, 2002/07/26