refactor: improved code readability
This commit is contained in:
		
							parent
							
								
									2d7902c31c
								
							
						
					
					
						commit
						a0bb24464d
					
				
					 1 changed files with 10 additions and 9 deletions
				
			
		|  | @ -4,14 +4,15 @@ func _ready(): | |||
| 	await get_tree().process_frame | ||||
| 	move_window_to_bottom_right() | ||||
| 
 | ||||
| 
 | ||||
| func move_window_to_bottom_right(): | ||||
| 	var display_index = DisplayServer.window_get_current_screen() | ||||
| 	 | ||||
| 	var work_area_position = DisplayServer.screen_get_usable_rect(display_index).position | ||||
| 	var work_area_size = DisplayServer.screen_get_usable_rect(display_index).size | ||||
| 	 | ||||
| 	var window_size = DisplayServer.window_get_size() | ||||
| 	 | ||||
| 	var new_position = work_area_position + Vector2i(work_area_size.x - window_size.x, work_area_size.y - window_size.y) | ||||
| 	 | ||||
| 	var display_index: int = DisplayServer.window_get_current_screen() | ||||
| 
 | ||||
| 	var work_area_position: Vector2i = DisplayServer.screen_get_usable_rect(display_index).position | ||||
| 	var work_area_size: Vector2i     = DisplayServer.screen_get_usable_rect(display_index).size | ||||
| 
 | ||||
| 	var window_size: Vector2i = DisplayServer.window_get_size() | ||||
| 
 | ||||
| 	var new_position: Vector2i = work_area_position + Vector2i(work_area_size.x - window_size.x, work_area_size.y - window_size.y) | ||||
| 
 | ||||
| 	DisplayServer.window_set_position(new_position) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Gerard Gascón
						Gerard Gascón