mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	fix(sprite2d): Rect is not handling pixel snap
related https://github.com/godotengine/godot/issues/42985
This commit is contained in:
		
							parent
							
								
									67f64ef4fe
								
							
						
					
					
						commit
						e892a92ad6
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -366,6 +366,9 @@ Rect2 Sprite2D::get_rect() const { | ||||||
| 	if (centered) { | 	if (centered) { | ||||||
| 		ofs -= Size2(s) / 2; | 		ofs -= Size2(s) / 2; | ||||||
| 	} | 	} | ||||||
|  | 	if (Engine::get_singleton()->get_use_pixel_snap()) { | ||||||
|  | 		ofs = ofs.floor(); | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	if (s == Size2(0, 0)) { | 	if (s == Size2(0, 0)) { | ||||||
| 		s = Size2(1, 1); | 		s = Size2(1, 1); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Eric Tuvesson
						Eric Tuvesson