Commit f952d130 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

Better fix for the local image working with preload

parent a8384035
...@@ -6,6 +6,7 @@ class Transition extends React.Component { ...@@ -6,6 +6,7 @@ class Transition extends React.Component {
const { width, height, shader, progress, from, to, uniforms } = this.props; const { width, height, shader, progress, from, to, uniforms } = this.props;
const scale = React.PixelRatio.get(); const scale = React.PixelRatio.get();
return <GL.View return <GL.View
preload
shader={shader} shader={shader}
width={width} width={width}
height={height} height={height}
......
...@@ -56,6 +56,7 @@ class Vignette extends React.Component { ...@@ -56,6 +56,7 @@ class Vignette extends React.Component {
const { width, height, time, source } = this.props; const { width, height, time, source } = this.props;
const { finger } = this.state; const { finger } = this.state;
return <GL.View return <GL.View
preload
onStartShouldSetResponder={() => true} onStartShouldSetResponder={() => true}
onMoveShouldSetResponder={() => true} onMoveShouldSetResponder={() => true}
onResponderMove={this.onResponderMove} onResponderMove={this.onResponderMove}
......
...@@ -79,9 +79,10 @@ RCT_NOT_IMPLEMENTED(-init) ...@@ -79,9 +79,10 @@ RCT_NOT_IMPLEMENTED(-init)
// Load the image (without resizing it) // Load the image (without resizing it)
if (![_src hasPrefix:@"http://"] && ![_src hasPrefix:@"https://"]) { if (![_src hasPrefix:@"http://"] && ![_src hasPrefix:@"https://"]) {
// N.B: in this case we don't trigger onload because image is already loaded.
// this behavior is specific to GLCanvas needs
self.image = [UIImage imageNamed:_src]; self.image = [UIImage imageNamed:_src];
dispatch_async(dispatch_get_main_queue(), ^{
if (_onload) _onload();
});
} else { } else {
_loading = [_bridge.imageLoader loadImageWithTag:_src _loading = [_bridge.imageLoader loadImageWithTag:_src
size:CGSizeZero size:CGSizeZero
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment