File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
libraries/canvas-utils/src Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -509,8 +509,9 @@ impl Hash for RenderOutputType {
509509 image_data. hash ( state) ;
510510 }
511511 #[ cfg( target_family = "wasm" ) ]
512- Self :: CanvasFrame { canvas_id, .. } => {
512+ Self :: CanvasFrame { canvas_id, resolution } => {
513513 canvas_id. hash ( state) ;
514+ resolution. to_array ( ) . iter ( ) . for_each ( |x| x. to_bits ( ) . hash ( state) ) ;
514515 }
515516 }
516517 }
Original file line number Diff line number Diff line change @@ -157,8 +157,8 @@ impl CanvasImpl {
157157 let image_canvases_key = JsValue :: from_str ( CANVASES_OBJECT_KEY ) ;
158158
159159 let mut canvases = Reflect :: get ( & window_obj, & image_canvases_key) ;
160- if canvases. is_err ( ) {
161- Reflect :: set ( & JsValue :: from ( web_sys :: window ( ) . unwrap ( ) ) , & image_canvases_key, & Object :: new ( ) ) . unwrap ( ) ;
160+ if canvases. is_err ( ) || canvases . as_ref ( ) . map_or ( false , |v| v . is_undefined ( ) || v . is_null ( ) ) {
161+ Reflect :: set ( & window_obj . clone ( ) , & image_canvases_key, & Object :: new ( ) ) . unwrap ( ) ;
162162 canvases = Reflect :: get ( & window_obj, & image_canvases_key) ;
163163 }
164164
You can’t perform that action at this time.
0 commit comments