plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

JoshC avatar image
JoshC asked JoshC commented

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.


1671425481138.png

wasmnanovggdi+
1671425481138.png (211.8 KiB)
7 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

JoshC avatar image JoshC commented ·
@FlyingRaccoon Are you able to help get the right dev to check?


0 Likes 0 ·
FlyingRaccoon avatar image FlyingRaccoon ♦♦ JoshC commented ·
Hello @JoshC

It's in my todo list, I'll get there eventually.

Regards,
Sylvain

0 Likes 0 ·
FlyingRaccoon avatar image FlyingRaccoon ♦♦ commented ·
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

0 Likes 0 ·
JoshC avatar image JoshC FlyingRaccoon ♦♦ commented ·
Thanks for the update.
0 Likes 0 ·
JoshC avatar image JoshC FlyingRaccoon ♦♦ commented ·

Has anyone had the time to look at this?

0 Likes 0 ·
FlyingRaccoon avatar image FlyingRaccoon ♦♦ JoshC commented ·
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

0 Likes 0 ·
Show more comments

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.