[cairo] New ruby cairo binding landed in CVS
mental at rydia.net
mental at rydia.net
Tue Feb 8 15:12:19 PST 2005
Quoting Ned Konz <ned at squeakland.org>:
> Why not take a block for the path?
>
> See the attached.
I'm not sure I understand the utility of stroked_path and
closed_path, nor of passing parameters to the block (blocks are
closures after all, you can use local variables tranparently)...
save_during looks like a very good idea though, although I have
mixed feelings about the name.
May I recommend something like:
def restore_after
save
begin
yield
finally
restore
end
end
That way, we don't leave the context in an unknown state if an
exception is thrown from within the block.
-mental
More information about the cairo
mailing list