Render offset on native

What I try to do:

I have two sprites, one is 3px high, the other is 9 pixel high with 3 coloured pixels in the centre. I want to cover the centre of the larger sprite with the 3px sprite. Actually cover 3px with 3px, easy.

testRect_x4 4xsize plate_x4 4xsize

Unfortunately I get different results on native and web.

Result native:
result_simulator

Result web:
result_web

Obviously there is something wrong with the rendering on native, Position and viewScale of the sprites are all integers. There should be no rounding of values, which could cause such behaviour.

I also tried to set the precision of the shader to highp as mentioned in this post 安卓平台上,帧动画发生不规则抖动 - Cocos2d-x - Cocos中文社区, with no difference.

How to get same results on web and native??

Open an issue https://github.com/cocos-creator/engine/issues

I think this is the same problem, and solved mine the same way.

There should be an easier way to set CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL globally.