[reportlab-users] diagonal ShadedRect and Clipping ?

Robin Becker reportlab-users@reportlab.com
Tue, 6 Aug 2002 12:17:15 +0100


In article <2489.28.1.42.70.1028624660.squirrel@web03.rasselstein-
hoesch.de>, Dirk Datzert <dirk.datzert@tks-rasselstein.thyssenkrupp.com>
writes
>> Le Lundi 05 Août 2002 22:00, vous avez écrit :
>>
>> It looks like emulated shading. I know PDF supports true shading but
>> maybe  renderPM does not ?
>
>Yes, ShadedRect is emulating shading, but that is not my problem, since I'm
>not writing the ShadedRect class which does the emulating shading for me ;-)
>
>I'm doing the rotation and clipping (which is my problem) after rotation.
>
>Regards,
>Dirk
OK the problem we have is the following.

First we have no notion of setting the canvas' clipPath explicitly and
second we have no notion of cancelling a clipPath (presumably that would
mean we need to revert to a previous clipping path if any).

Logically the clipPath should be set on when isClipPath = 1 is true and
we draw a path. The problem is when should it be turned off?

In the current example bplane is the rotated shaded thing and rect is
the foreground rectangle.

logically we need
        result.add(clip)        # start clipping
        result.add(bplane)      # this will be clipped
        result.add(antiClip)    # this turns off clipping
        result.add(rect)
        return result


I claim we either need a one or other of
        special path 
        another path attribute isAntiClipPath
        another path operation
        special Shape

I will have a go at the first ie a predefined path AntiClipPath to see
if it works out.
-- 
Robin Becker