@@ -110,11 +110,7 @@ def paintEvent(self, event) -> None:
110110 event (QPaintEvent): The paint event.
111111 """
112112 self .paintWebGPU ()
113- if (
114- hasattr (self , "device" )
115- and self .device is not None
116- and hasattr (self , "colour_buffer_texture" )
117- ):
113+ if hasattr (self , "device" ) and self .device is not None and hasattr (self , "colour_buffer_texture" ):
118114 self ._update_colour_buffer ()
119115 painter = QPainter (self )
120116
@@ -242,9 +238,7 @@ def _update_colour_buffer(self) -> None:
242238 {
243239 "buffer" : self .readback_buffer ,
244240 "bytes_per_row" : bytes_per_row , # Aligned row stride
245- "rows_per_image" : self .texture_size [
246- 1
247- ], # Number of rows in the texture
241+ "rows_per_image" : self .texture_size [1 ], # Number of rows in the texture
248242 },
249243 (
250244 self .texture_size [0 ],
@@ -299,9 +293,7 @@ def _present_image(self, painter, image_data: np.ndarray) -> None:
299293 rect2 = self .rect ()
300294 painter .drawImage (rect2 , image , rect1 )
301295
302- def _create_render_pass (
303- self , command_encoder : wgpu .GPUCommandEncoder
304- ) -> wgpu .GPURenderPassEncoder :
296+ def _create_render_pass (self , command_encoder : wgpu .GPUCommandEncoder ) -> wgpu .GPURenderPassEncoder :
305297 """
306298 Create a render pass with the configured background color.
307299
0 commit comments