File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/replay-canvas/src Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,22 @@ const CANVAS_QUALITY = {
55
55
} ;
56
56
57
57
const INTEGRATION_NAME = 'ReplayCanvas' ;
58
+ const DEFAULT_MAX_CANVAS_SIZE = 1280 ;
58
59
59
60
/** Exported only for type safe tests. */
60
61
export const _replayCanvasIntegration = ( ( options : Partial < ReplayCanvasOptions > = { } ) => {
62
+ const [ maxCanvasWidth , maxCanvasHeight ] = options . maxCanvasSize || [ ] ;
61
63
const _canvasOptions = {
62
64
quality : options . quality || 'medium' ,
63
65
enableManualSnapshot : options . enableManualSnapshot ,
64
- maxCanvasSize : options . maxCanvasSize || [ 1280 , 1280 ] ,
66
+ maxCanvasSize : [
67
+ maxCanvasWidth ?
68
+ Math . min ( maxCanvasWidth , DEFAULT_MAX_CANVAS_SIZE )
69
+ : DEFAULT_MAX_CANVAS_SIZE ,
70
+ maxCanvasHeight ?
71
+ Math . min ( maxCanvasHeight , DEFAULT_MAX_CANVAS_SIZE )
72
+ : DEFAULT_MAX_CANVAS_SIZE
73
+ ] ,
65
74
} ;
66
75
67
76
let canvasManagerResolve : ( value : CanvasManager ) => void ;
You can’t perform that action at this time.
0 commit comments