MetalNanoVG
MetalNanoVG copied to clipboard
With stencil strokes enabled, strokewidth = 1. is invisible on non-retina screen
This didn't used to be the case. Here is a test project demonstrating the problem:
https://github.com/olilarkin/TestNVGMetal/blob/master/TestNVGMetal/Renderer.m#L13
Is it visible on a retina screen?
yes

this is how the Moui demo looks on non-retina if i enable stencil strokes
I believe on retina screen the strokes are also thinner than they should be
@olilarkin Are you using macOS older than 10.14? I saw the same effect on my old MacBook Air with macOS 10.13.x installed. However, the issue is gone after I upgraded the macOS to Mojave (10.14). But Mojave introduces other new weird effects on my old MacBook Air. WIll investigate into it later.
yes. this is on 10.13
So that's the issue only happened on 10.13. Unfortunately, all of my mac devices are upgraded to 10.14. You will need to fix it by yourself if you want to run it on 10.13.
I also found that there is a problem when resizing window on 10.13 and the issue is gone on 10.14.
@olilarkin It seems that commenting out this line would fix the issue: https://github.com/ollix/MetalNanoVG/blob/e1aad96565191638d4c8e0a804674b70837d6bcb/src/nanovg_mtl.m#L683
Can you test it in your real project to check if there is any side effect?
i'm away from my non-retina screen at the moment, but i can test next week
Sure. Please test your real project on both retina and non-retina screens. :)
Good work :-) it fixes the problem. My project and Moui NanoVG demo look fine on both screens now
@olilarkin Thanks for reporting. I just found that the transparency is gone for this solution. We'll need another solution. :(