File tree 2 files changed +15
-10
lines changed
apps/paper/src/Examples/Breathe
packages/skia/ios/RNSkia-iOS
2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 1
1
import React , { useMemo } from "react" ;
2
- import { StyleSheet , useWindowDimensions } from "react-native" ;
2
+ import { StyleSheet , useWindowDimensions , View } from "react-native" ;
3
3
import {
4
4
BlurMask ,
5
5
vec ,
@@ -67,15 +67,17 @@ export const Breathe = () => {
67
67
) ;
68
68
69
69
return (
70
- < Canvas style = { styles . container } >
71
- < Fill color = "rgb(36,43,56)" />
72
- < Group origin = { center } transform = { transform } blendMode = "screen" >
73
- < BlurMask style = "solid" blur = { 40 } />
74
- { new Array ( 6 ) . fill ( 0 ) . map ( ( _ , index ) => {
75
- return < Ring key = { index } index = { index } progress = { progress } /> ;
76
- } ) }
77
- </ Group >
78
- </ Canvas >
70
+ < View style = { { flex : 1 } } >
71
+ < Canvas style = { styles . container } >
72
+ < Fill color = "rgb(36,43,56)" />
73
+ < Group origin = { center } transform = { transform } blendMode = "screen" >
74
+ < BlurMask style = "solid" blur = { 40 } />
75
+ { new Array ( 6 ) . fill ( 0 ) . map ( ( _ , index ) => {
76
+ return < Ring key = { index } index = { index } progress = { progress } /> ;
77
+ } ) }
78
+ </ Group >
79
+ </ Canvas >
80
+ </ View >
79
81
) ;
80
82
} ;
81
83
Original file line number Diff line number Diff line change 77
77
// usage growing very fast in the simulator without this.
78
78
@autoreleasepool {
79
79
auto surface = _ctx->getSurface ();
80
+ if (!surface) {
81
+ return false ;
82
+ }
80
83
auto canvas = surface->getCanvas ();
81
84
cb (canvas);
82
85
_ctx->present ();
You can’t perform that action at this time.
0 commit comments