mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	[Scene] Add SceneStringNames::font(_size/_color)
				
					
				
			This commit is contained in:
		
							parent
							
								
									b435551682
								
							
						
					
					
						commit
						d519715d94
					
				
					 77 changed files with 453 additions and 446 deletions
				
			
		|  | @ -658,8 +658,8 @@ void CurveEdit::set_selected_index(int p_index) { | |||
| } | ||||
| 
 | ||||
| void CurveEdit::update_view_transform() { | ||||
| 	Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); | ||||
| 	int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); | ||||
| 	Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label")); | ||||
| 	int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label")); | ||||
| 
 | ||||
| 	const real_t margin = font->get_height(font_size) + 2 * EDSCALE; | ||||
| 
 | ||||
|  | @ -820,10 +820,10 @@ void CurveEdit::_redraw() { | |||
| 	// Draw number markings.
 | ||||
| 	draw_set_transform_matrix(Transform2D()); | ||||
| 
 | ||||
| 	Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); | ||||
| 	int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); | ||||
| 	Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label")); | ||||
| 	int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label")); | ||||
| 	float font_height = font->get_height(font_size); | ||||
| 	Color text_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)); | ||||
| 	Color text_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)); | ||||
| 
 | ||||
| 	for (int i = 0; i <= grid_steps.x; ++i) { | ||||
| 		real_t x = i * step_size.x; | ||||
|  | @ -841,8 +841,8 @@ void CurveEdit::_redraw() { | |||
| 	// The scaling up ensures that the curve rendering doesn't break when we use a quad line to draw it.
 | ||||
| 	draw_set_transform_matrix(Transform2D(0, get_view_pos(Vector2(0, 0)))); | ||||
| 
 | ||||
| 	const Color line_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)); | ||||
| 	const Color edge_line_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)) * Color(1, 1, 1, 0.75); | ||||
| 	const Color line_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)); | ||||
| 	const Color edge_line_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)) * Color(1, 1, 1, 0.75); | ||||
| 
 | ||||
| 	CanvasItemPlotCurve plot_func(*this, line_color, edge_line_color); | ||||
| 	plot_curve_accurate(**curve, 2.f, (get_view_pos(Vector2(1, curve->get_max_value())) - get_view_pos(Vector2(0, curve->get_min_value()))) / Vector2(1, curve->get_range()), plot_func); | ||||
|  | @ -852,7 +852,7 @@ void CurveEdit::_redraw() { | |||
| 
 | ||||
| 	bool shift_pressed = Input::get_singleton()->is_key_pressed(Key::SHIFT); | ||||
| 
 | ||||
| 	const Color point_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)); | ||||
| 	const Color point_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)); | ||||
| 
 | ||||
| 	for (int i = 0; i < curve->get_point_count(); ++i) { | ||||
| 		Vector2 pos = get_view_pos(curve->get_point_position(i)); | ||||
|  | @ -873,7 +873,7 @@ void CurveEdit::_redraw() { | |||
| 		// Draw tangents if not dragging a point, or if holding a point without having moved it yet.
 | ||||
| 		if (grabbing == GRAB_NONE || initial_grab_pos == point_pos || selected_tangent_index != TANGENT_NONE) { | ||||
| 			const Color selected_tangent_color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor)).darkened(0.25); | ||||
| 			const Color tangent_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)).darkened(0.25); | ||||
| 			const Color tangent_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)).darkened(0.25); | ||||
| 
 | ||||
| 			if (selected_index != 0) { | ||||
| 				Vector2 control_pos = get_tangent_view_pos(selected_index, TANGENT_LEFT); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 A Thousand Ships
						A Thousand Ships