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 {
const { width, height, shader, progress, from, to, uniforms } = this.props;
const scale = React.PixelRatio.get();
return <GL.View
preload
shader={shader}
width={width}
height={height}
......
......@@ -56,6 +56,7 @@ class Vignette extends React.Component {
const { width, height, time, source } = this.props;
const { finger } = this.state;
return <GL.View
preload
onStartShouldSetResponder={() => true}
onMoveShouldSetResponder={() => true}
onResponderMove={this.onResponderMove}
......
......@@ -79,9 +79,10 @@ RCT_NOT_IMPLEMENTED(-init)
// Load the image (without resizing it)
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];
dispatch_async(dispatch_get_main_queue(), ^{
if (_onload) _onload();
});
} else {
_loading = [_bridge.imageLoader loadImageWithTag:_src
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