Skip to content

Commit d7dadc8

Browse files
committed
[ptmt#18] ScrollView: show bars
1 parent 9f6d752 commit d7dadc8

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

Libraries/Image/RCTImageView.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ - (void)setContentMode:(UIViewContentMode)mode
168168
case UIViewContentModeScaleAspectFill:
169169
_layer.contentsGravity = kCAGravityResizeAspectFill;
170170
_layer.masksToBounds = YES;
171-
// NSLog(@"bounds: %f %f", self.bounds.size.height, self.bounds.size.width);
172-
// NSLog(@"frame: %f %f", self.frame.size.height, self.frame.size.width);
173-
174171
_layer.needsDisplayOnBoundsChange = YES;
175172
break;
176173

@@ -286,7 +283,6 @@ - (void)reloadImage
286283
_onLoad(nil);
287284
}
288285
}
289-
NSLog(@"bounds: %f %f", self.layer.bounds.size.height, self.layer.bounds.size.width);
290286
if (_onLoadEnd) {
291287
_onLoadEnd(nil);
292288
}

React/Views/RCTScrollView.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,8 @@ - (void)sendScrollEventWithType:(RCTScrollEventType)type
912912

913913
@implementation RCTNativeScrollView
914914
{
915-
NSColor * _backgroundColor; // TODO: why?
915+
NSColor * _backgroundColor;
916+
RCTEventDispatcher *_eventDispatcher;
916917
}
917918

918919
RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
@@ -922,6 +923,7 @@ - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
922923
{
923924
if ((self = [super initWithFrame:CGRectZero])) {
924925
_backgroundColor = [NSColor clearColor];
926+
_eventDispatcher = eventDispatcher;
925927
[self setDrawsBackground:NO];
926928

927929
}
@@ -938,6 +940,16 @@ - (BOOL)opaque
938940
return NO;
939941
}
940942

943+
- (void)setShowsVerticalScrollIndicator:(BOOL)value
944+
{
945+
self.hasVerticalScroller = value;
946+
}
947+
948+
- (void)setShowsHorizontalScrollIndicator:(BOOL)value
949+
{
950+
self.hasHorizontalScroller = value;
951+
}
952+
941953
- (void)removeReactSubview:(NSView *)subview
942954
{
943955
[subview removeFromSuperview];
@@ -964,7 +976,6 @@ - (void)setBackgroundColor:(NSColor *)backgroundColor
964976
} else {
965977
[self.layer setBackgroundColor:[backgroundColor CGColor]];
966978
}
967-
[self.layer setNeedsDisplay];
968979
[self setNeedsDisplay:YES];
969980
}
970981

React/Views/RCTScrollViewManager.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,7 @@ - (NSView *)view
127127
return [[RCTNativeScrollView alloc] initWithEventDispatcher:self.bridge.eventDispatcher];
128128
}
129129

130+
RCT_EXPORT_VIEW_PROPERTY(showsHorizontalScrollIndicator, BOOL)
131+
RCT_EXPORT_VIEW_PROPERTY(showsVerticalScrollIndicator, BOOL)
132+
130133
@end

React/Views/RCTViewManager.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(__unused RCTSpars
143143
}
144144
RCT_CUSTOM_VIEW_PROPERTY(transformMatrix, CATransform3D, RCTView)
145145
{
146-
NSLog(@"superview %@", view.superview);
146+
CATransform3D transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;
147147
if (!view.superview) {
148148
view.shouldBeTransformed = YES;
149-
view.transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;
149+
view.transform = transform;
150150
} else {
151-
view.layer.transform = json ? [RCTConvert CATransform3D:json] : defaultView.layer.transform;
151+
view.layer.transform = transform;
152152
}
153153

154154
// TODO: Improve this by enabling edge antialiasing only for transforms with rotation or skewing
155-
view.layer.edgeAntialiasingMask = !CATransform3DIsIdentity(view.layer.transform);
155+
view.layer.edgeAntialiasingMask = !CATransform3DIsIdentity(transform);
156156
}
157157

158158
//RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTPointerEvents, RCTView)

0 commit comments

Comments
 (0)