Merge pull request #42995 from Ev1lbl0w/bugfix-zoom-visibility

Fix visibility issue with zoom label
This commit is contained in:
Rémi Verschelde 2020-10-26 11:15:50 +01:00 committed by GitHub
commit a3396fabd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -52,6 +52,7 @@
#include "scene/gui/subviewport_container.h"
#include "scene/main/canvas_layer.h"
#include "scene/main/window.h"
#include "scene/resources/dynamic_font.h"
#include "scene/resources/packed_scene.h"
// Min and Max are power of two in order to play nicely with successive increment.
@ -5727,6 +5728,11 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
zoom_reset = memnew(Button);
zoom_reset->set_flat(true);
zoom_hb->add_child(zoom_reset);
Ref<DynamicFont> font = zoom_reset->get_theme_font("font")->duplicate(false);
font->set_outline_size(1);
font->set_outline_color(Color(0, 0, 0));
zoom_reset->add_theme_font_override("font", font);
zoom_reset->add_theme_color_override("font_color", Color(1, 1, 1));
zoom_reset->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_zoom_reset));
zoom_reset->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", TTR("Zoom Reset"), KEY_MASK_CMD | KEY_0));
zoom_reset->set_focus_mode(FOCUS_NONE);