diff --git a/app/components/ZdogAndTests.js b/app/components/ZdogAndTests.js index 31ddc7c..8444134 100644 --- a/app/components/ZdogAndTests.js +++ b/app/components/ZdogAndTests.js @@ -396,6 +396,7 @@ export default class ZdogAndTests extends Component { this.canvas = null; this.state = { debugInfo: 'Click me to draw some on canvas', + hasOc1: false, }; // only useful on Android, because it's always true on iOS @@ -499,6 +500,23 @@ export default class ZdogAndTests extends Component { {this.state.debugInfo} + {Platform.OS !== 'web' && ( + this.setState({hasOc1: true})} // it's better to setState some as describe in https://github.com/flyskywhy/react-native-gcanvas/blob/master/README.MD + devicePixelRatio={1} // should not 1 < devicePixelRatio < 2 as float to avoid pixel offset flaw when GetImageData with PixelsSampler in @flyskywhy/react-native-gcanvas/core/src/support/GLUtil.cpp + isGestureResponsible={false} // who will need gesture with offscreen canvas? + /> + )} + {Platform.OS === 'web' ? ( - ) : ( + ) : (this.state.hasOc1 && ( - )} + ))} Click me runTests react-native-browser-polyfill