MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / set_zoom_factor

Method set_zoom_factor

editor/gui/code_editor.cpp:1847–1855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1845}
1846
1847void CodeTextEditor::set_zoom_factor(float p_zoom_factor) {
1848 zoom_factor = CLAMP(p_zoom_factor, 0.25f, 3.0f);
1849 int neutral_font_size = int(EDITOR_GET("interface/editor/code_font_size")) * EDSCALE;
1850 int new_font_size = Math::round(zoom_factor * neutral_font_size);
1851
1852 zoom_button->set_text(itos(Math::round(zoom_factor * 100)) + " %");
1853
1854 text_editor->add_theme_font_size_override(SceneStringName(font_size), new_font_size);
1855}
1856
1857float CodeTextEditor::get_zoom_factor() {
1858 return zoom_factor;

Callers 4

editMethod · 0.80
editMethod · 0.80

Calls 5

CLAMPFunction · 0.85
roundFunction · 0.85
itosFunction · 0.85
set_textMethod · 0.45

Tested by

no test coverage detected