PHP 7.4.33
Preview: RCTScrollContentShadowView.m Size: 977 B
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/React/Views/ScrollView/RCTScrollContentShadowView.m
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#import "RCTScrollContentShadowView.h"

#import <yoga/Yoga.h>

#import "RCTUtils.h"

@implementation RCTScrollContentShadowView

- (void)layoutWithMetrics:(RCTLayoutMetrics)layoutMetrics layoutContext:(RCTLayoutContext)layoutContext
{
  if (layoutMetrics.layoutDirection == UIUserInterfaceLayoutDirectionRightToLeft) {
    // Motivation:
    // Yoga place `contentView` on the right side of `scrollView` when RTL layout is enforced.
    // That breaks everything; it is completely pointless to (re)position `contentView`
    // because it is `contentView`'s job. So, we work around it here.

    layoutContext.absolutePosition.x += layoutMetrics.frame.size.width;
    layoutMetrics.frame.origin.x = 0;
  }

  [super layoutWithMetrics:layoutMetrics layoutContext:layoutContext];
}

@end

Directory Contents

Dirs: 0 × Files: 13
Name Size Perms Modified Actions
1.40 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
309 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
977 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
291 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
704 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
287 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
527 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
904 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
3.24 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
3.21 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
44.97 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
431 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
7.69 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).