Skip to content

Commit

Permalink
style: format and rename variables (#2469)
Browse files Browse the repository at this point in the history
# Summary

Formatting and rename variable committed in #2415
  • Loading branch information
jakex7 authored Sep 30, 2024
1 parent cc96177 commit cd47aec
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 19 deletions.
34 changes: 19 additions & 15 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,38 +145,42 @@ export default () => {
);
};
```

# Web configuration

## Metro bundler

No additional steps are required when using Metro bundler.

## Webpack

If you are using the Webpack bundler, the following steps are needed:

- Install `@react-native/assets-registry/registry` as a project dependency.
- Ensure that you have the proper configuration to parse flow files from `@react-native/assets-registry/registry`.
- Configure the Webpack `module -> rules` section and include an important rule for `node_modules/@react-native/assets-registry/registry`.

webpack.config.js
```ts
const babelLoaderConfiguration = {
include: [
path.resolve(
appDirectory,
// Important!
'node_modules/@react-native/assets-registry/registry',
),
],
...

```ts
const babelLoaderConfiguration = {
include: [
path.resolve(
appDirectory,
// Important!
'node_modules/@react-native/assets-registry/registry',
),
],
...
};

module.exports = {
...config,
module: {
rules: [babelLoaderConfiguration],
},
...config,
module: {
rules: [babelLoaderConfiguration],
},
};
```
```

For more details on the complete Webpack configuration, you can refer to this [documentation](https://necolas.github.io/react-native-web/docs/multi-platform/#compiling-and-bundling) on how to set up a `webpack.config` file for React Native Web.

Expand Down
7 changes: 6 additions & 1 deletion android/src/main/java/com/horcrux/svg/RenderableView.java
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,12 @@ void render(Canvas canvas, Paint paint, float opacity) {
float maskY = (float) relativeOnFraction(mask.mY, clientRect.height());
float maskWidth = (float) relativeOnFraction(mask.mW, clientRect.width());
float maskHeight = (float) relativeOnFraction(mask.mH, clientRect.height());
maskBounds = new RectF(clientRect.left + maskX, clientRect.top + maskY, clientRect.left + maskX + maskWidth, clientRect.top + maskY + maskHeight);
maskBounds =
new RectF(
clientRect.left + maskX,
clientRect.top + maskY,
clientRect.left + maskX + maskWidth,
clientRect.top + maskY + maskHeight);
}
// clip to mask bounds
canvas.clipRect(maskBounds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ public void setBorderBlockStartColor(SvgView view, @Nullable Integer value) {
}

public void setBorderRadius(ReactViewGroup view, int index, Dynamic rawBorderRadius) {
double test = 0;
double borderRadius = 0;
if (rawBorderRadius.getType() == ReadableType.Number) {
test = rawBorderRadius.asDouble();
borderRadius = rawBorderRadius.asDouble();
}
super.setBorderRadius(view, index, (float) test);
super.setBorderRadius(view, index, (float) borderRadius);
}

@Override
Expand Down

0 comments on commit cd47aec

Please sign in to comment.