Web platform for sharing free image data for ML and research

Homepage: https://datasets.roundabout-host.com

Zoom to centre, for now

by roundabout, Monday, 6 January 2025, 14:13:29 (1736172809), pushed by roundabout, Tuesday, 7 January 2025, 08:25:28 (1736238328)

Author identity: vlad <vlad.muntoiu@gmail.com>

b4d8c86815de8ddec03893591587848f0abacaf0

static/picture-annotation.py

@@ -718,17 +718,10 @@ def on_wheel(event):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                event.preventDefault()
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            scale_exponent += (-1 if event.deltaY > 0 else 1) / 16
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # Adjust scale exponent and compute new scale
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            scale_exponent += (-1 if event.deltaY > 0 else 1) / 4
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                new_scale = 2 ** scale_exponent
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            rect = zoom_container.getBoundingClientRect()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            pointer_x = event.clientX - rect.left
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            pointer_y = event.clientY - rect.top
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            translate_x = pointer_x - (pointer_x - translate_x) * (new_scale / scale)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            translate_y = pointer_y - (pointer_y - translate_y) * (new_scale / scale)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # Update scale
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                scale = new_scale
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                update_transform()