Nanovg SetClip operations do not work correctly

Hi, Currently I am unable to get clips working correctly. Replace, and Exclude
works perfectly. But Intersect acts the same as Union and Complement acts the
same as Exclude. Is Asobo aware of this? Below image is a sample “dirty” code
to test it using the gdi+ wrapper (The result would be the same even if you
use nvg directly.) 1.Rect 1 is drawn 300x300 using Pink Color 2.SetClip is
called for 300x300 Replace Operation 3.SetClip is called for 100x100 Intersect
Operation. 4. Rect 1 is drawn again 300 x300 using White Color 5. Result
should be only the 100x100 white area. However, as you can see from the image
capture, it is simply a union operation on the clip, remaining 300x300. If I
use a replace clip, to replace the entire clip section, the result will be
what I want, but intersect is needed for masking operations of more complex
figures.

@FlyingRaccoon Are you able to help get the
right dev to check?

Hello @JoshC It’s in my todo list, I’ll get there
eventually. Regards, Sylvain

Hello @JoshC I just wanted to let you know that I
was able to reproduce the problem and add it to the list of our tracked
issues. In my tests, the Intersect mode wasn’t behaving as Union but was
rather doing nothing to the initial clip. The developer in charge of this part
of the engine is out of office at the moment but we will review the issue when
he gets back. Regards, Sylvain

Thanks for the update.

Has anyone had the time to look at this?

Hello @JoshC Not yet. All of our developers are busy
and this was not reviewed yet. I can’t provide any ETA on when this will get
fixed. In the meantime, did you consider using image masks? Regards, Sylvain

I would prefer to not use pre-rendered/non scalable bitmaps. Unless we have
the option to draw on a offscreen bitmap using nanovg and use it as a
resource…

Is there any update on this at all? Can the SDK at least be updated to reflect the setclip operation not working to not waste other devs time with troubleshooting clips??

Hello @JoshC

There is a fix coming for this.
I’ll update this post as soon as it’s available for you to test.

Regards,
Sylvain

Hello @JoshC ,

This is fixed in the current flighting SU14.

Regards,
Boris

Is there some example anywhere on how to clip using NVG without the GDI wrapper?