[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Coordinate transformatioins [Was: Release of gui libraries]
From: |
Willem Rein Oudshoorn |
Subject: |
Re: Coordinate transformatioins [Was: Release of gui libraries] |
Date: |
28 Jan 2002 00:22:38 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
Adam Fedor <fedor@doc.com> writes:
> Willem Rein Oudshoorn wrote:
>
>
> > Well, it is not something I look forward to, but if xgps crashes
> > I would like to fix this. Actaully, I hope that someone can send
> > me a step by step scenario for reproducing the crash.
> > (I do not like to guess)
> >
>
>
> Here's how I reproduced it.
>
> 1. Start GWorkspace
> 2. In the file browser, select an image (gif, or perhaps others) that
> you know is bigger than the content inspector view (about 257 by 235
> pixels).
> 3. In the main menu, select Tools->Inspectors->Contents
Thanks. I have found the problem, also there is a quick fix but
it might not be the correct fix.
Let me describe what happens:
The inspector in GWorkspace scales to image proportionally to fit
the inspector. This is done in NSImageCell. The calculation in
NSImageCell will result in either the height or the width being non
integer. The NSImageCell will call setSize on the image with this
non-integer size. Now when displaying at a non-integer coordinate
the xgps backend will sometimes round the size upwards. This can/will
result in two things:
1 - X-protocol errors
2 - Crash
Now the quick fix is to modify setSize in NSImage to round the size
downwards to the nearest integer.
This is a reasonable fix if we assume that Bitmaps will not/are not
subject to the coordinate transformations from Postscript --> Device
coordinates.
I think that on the Next machines Bitmaps were indeed exempt from these
transformations (except flipping).
If at some point in the future we want to honour the Postscript-->Device
mapping for images it will not work.
I can make a patch out of it, but not now (it is pretty late, so
it maybe it is nonsense)
Wim Oudshoorn