mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:02:45 +00:00 
			
		
		
		
	SpaceAnalyzer: Adjust the text_rect
The text_rect was moved to the bottom right instead of being shrinked, which meant that the text at the end could go a bit out of the box.
This commit is contained in:
		
							parent
							
								
									3bbab9eb47
								
							
						
					
					
						commit
						2ded2a8b15
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -93,13 +93,13 @@ void TreeMapWidget::paint_cell_frame(GUI::Painter& painter, const TreeMapNode& n | |||
| 
 | ||||
|     // Paint text.
 | ||||
|     if (has_label == HasLabel::Yes) { | ||||
|         painter.clear_clip_rect(); | ||||
|         painter.add_clip_rect(cell_rect); | ||||
|         Gfx::IntRect text_rect = remainder; | ||||
|         text_rect.translate_by(2, 2); | ||||
|         text_rect.shrink(4, 4); | ||||
|         painter.clear_clip_rect(); | ||||
|         painter.add_clip_rect(text_rect); | ||||
|         if (node_is_leaf(node)) { | ||||
|             painter.draw_text(text_rect, node.name(), font(), Gfx::TextAlignment::TopLeft, Color::Black); | ||||
|             text_rect.translate_by(0, font().presentation_size() + 1); | ||||
|             text_rect.take_from_top(font().presentation_size() + 1); | ||||
|             painter.draw_text(text_rect, human_readable_size(node.area()), font(), Gfx::TextAlignment::TopLeft, Color::Black); | ||||
|         } else { | ||||
|             painter.draw_text(text_rect, String::formatted("{} - {}", node.name(), human_readable_size(node.area())), font(), Gfx::TextAlignment::TopLeft, Color::Black); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Karol Kosek
						Karol Kosek