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

Implement events through for container when !visibleContent

parent f3aa34ff
......@@ -7,6 +7,7 @@
@property (nonatomic) BOOL opaque;
@property (nonatomic) BOOL autoRedraw;
@property (nonatomic) BOOL eventsThrough;
@property (nonatomic) BOOL visibleContent;
@property (nonatomic) NSNumber *nbContentTextures;
@property (nonatomic) NSNumber *renderId;
@property (nonatomic) NSArray *imagesToPreload;
......
......@@ -131,7 +131,20 @@ NSString* srcResource (id res)
- (void)setEventsThrough:(BOOL)eventsThrough
{
self.userInteractionEnabled = !eventsThrough;
_eventsThrough = eventsThrough;
[self updateUIE];
}
-(void)setVisibleContent:(BOOL)visibleContent
{
_visibleContent = visibleContent;
[self updateUIE];
}
- (void) updateUIE
{
self.userInteractionEnabled = !(_eventsThrough);
self.superview.userInteractionEnabled = !(_eventsThrough && !_visibleContent);
}
- (void)setData:(GLData *)data
......
......@@ -22,6 +22,7 @@ RCT_EXPORT_VIEW_PROPERTY(nbContentTextures, NSNumber);
RCT_EXPORT_VIEW_PROPERTY(opaque, BOOL);
RCT_EXPORT_VIEW_PROPERTY(autoRedraw, BOOL);
RCT_EXPORT_VIEW_PROPERTY(eventsThrough, BOOL);
RCT_EXPORT_VIEW_PROPERTY(visibleContent, BOOL);
RCT_EXPORT_VIEW_PROPERTY(data, GLData);
RCT_EXPORT_VIEW_PROPERTY(renderId, NSNumber);
RCT_EXPORT_VIEW_PROPERTY(imagesToPreload, NSArray);
......
......@@ -11,10 +11,10 @@ const {
const GLCanvas = requireNativeComponent("GLCanvas", null);
const renderVcontent = function (width, height, id, children, visibleContent) {
const renderVcontent = function (width, height, id, children, { visibleContent }) {
const childrenStyle = {
position: "absolute",
top: visibleContent ? 0 : height,
top: visibleContent ? 0 : height, // as a workaround for RN, we offset the content so it is not visible but still can be rasterized
left: 0,
width: width,
height: height,
......@@ -32,7 +32,7 @@ const renderVGL = function (props) {
/>;
};
const renderVcontainer = function (width, height, contents, renderer, style) {
const renderVcontainer = function ({ style, width, height }, contents, renderer) {
const parentStyle = {
position: "relative",
...style,
......
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