Removing current clipping
is there any way to remove clipping path? I haven't found any specific method so I've tried to set a new clipping to the size of full image, but it did not help. It looks like the clip can only be shrinked more and more but never enlarged. Or did I missed something?
Thanks for any help.
# set clip ui_path = ui.Path.rect(x, y, width, height) ui_path.add_clip() # remove clip ui_path = ui.Path.rect(0, 0, full_width, full_height) ui_path.add_clip()
From the docs, it would seem that add_clip can only shrink the clipping area.
maybe try using Gstate() to undo the effects:
with Gstate(): ui.Path.add_clip() #other clipped drawing ..... #unclipped drawing here
Thanks, that works. Unfortunately I cannot use the "with..." directly but storing the state and using state.enter() and state.exit() does exactly what I need. Would be nicer to use something like state.save() and state.restore() but I have not found anything like this.