[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix: NSView, view clipping
From: |
Georg Fleischmann |
Subject: |
Re: Fix: NSView, view clipping |
Date: |
Sat, 1 Sep 2001 18:38:20 +0200 |
Hi Fred,
> I am having the same drawing problems, where sometimes parts of a window
> is missing (e.g. in the Box test of GSTest).
Adam already mailed me, and he is checking the options to solve the problem.
> I had a look at your clipping code and did not quite
> understand it. Your code seems to add another stack to the graphics
> context, while we already use a stack for the gstates, which should be
> handling the clipping as well. I don't think that we should introduce a
> new PS call for this functionality, it should already be possible to
> implement this by correcting our current code.
The problem is, that view clipping is not handled by the graphics state.
That's why I added this little extra stack to the context. If view clipping is
really needed, an additional stack is necessary. Here is the excerpt from the
PostScript Reference:
...
The view clipping path is part of the PostScript execution context, not the
graphics state. A context initially has no view clipping path. The operators
that alter the view clipping path do not affect the clipping path in the
graphics state or vice versa. The view clipping path is not affected by gsave
and grestore. However, a restore will reinstate the view clipping path that was
in effect at the time of the matching save. View clips do not nest; rather, a
new view clipping path replaces the existing one.
...
> First of all [NSView lockFocusInRect:] looks wrong. It only uses the
> given rect to set the clipping when there is no gstate for the current
> view. This are, as far as I see it, two independent operations, the
True, the rectangle is never used for clipping when there is a gstate.
Maybe this should be fixed too.
> Perhaps solving this would make your problem disappear. If
> not the problem is with the gstate itself and we should have a closer
> look on this.
It makes it worse, because the view clipping won't be restored.
Georg