mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:02:45 +00:00 
			
		
		
		
	FontEditor: Draw the baseline in the glyph editor widget
This commit is contained in:
		
							parent
							
								
									f0fdbb1d83
								
							
						
					
					
						commit
						cba5a69f07
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		|  | @ -304,6 +304,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Gfx::Font>&& edite | ||||||
| 
 | 
 | ||||||
|     baseline_spinbox.on_change = [this, update_demo](int value) { |     baseline_spinbox.on_change = [this, update_demo](int value) { | ||||||
|         m_edited_font->set_baseline(value); |         m_edited_font->set_baseline(value); | ||||||
|  |         m_glyph_editor_widget->update(); | ||||||
|         update_demo(); |         update_demo(); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -58,8 +58,10 @@ void GlyphEditorWidget::paint_event(GUI::PaintEvent& event) | ||||||
|     painter.translate(frame_thickness(), frame_thickness()); |     painter.translate(frame_thickness(), frame_thickness()); | ||||||
| 
 | 
 | ||||||
|     painter.translate(-1, -1); |     painter.translate(-1, -1); | ||||||
|     for (int y = 1; y < font().glyph_height(); ++y) |     for (int y = 1; y < font().glyph_height(); ++y) { | ||||||
|         painter.draw_line({ 0, y * m_scale }, { font().max_glyph_width() * m_scale, y * m_scale }, palette().threed_shadow2()); |         bool bold_line = (y - 1) == font().baseline(); | ||||||
|  |         painter.draw_line({ 0, y * m_scale }, { font().max_glyph_width() * m_scale, y * m_scale }, palette().threed_shadow2(), bold_line ? 2 : 1); | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     for (int x = 1; x < font().max_glyph_width(); ++x) |     for (int x = 1; x < font().max_glyph_width(); ++x) | ||||||
|         painter.draw_line({ x * m_scale, 0 }, { x * m_scale, font().glyph_height() * m_scale }, palette().threed_shadow2()); |         painter.draw_line({ x * m_scale, 0 }, { x * m_scale, font().glyph_height() * m_scale }, palette().threed_shadow2()); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Tibor Nagy
						Tibor Nagy