mirror of
https://github.com/godotengine/godot
synced 2024-09-16 06:07:02 +00:00
Move snap_controls_to_pixels
from process to projects settings changed method
This commit is contained in:
parent
aef11a1427
commit
f99de3f024
|
@ -3911,16 +3911,19 @@ void CanvasItemEditor::_update_editor_settings() {
|
||||||
warped_panning = bool(EDITOR_GET("editors/panning/warped_mouse_panning"));
|
warped_panning = bool(EDITOR_GET("editors/panning/warped_mouse_panning"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CanvasItemEditor::_project_settings_changed() {
|
||||||
|
EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET("gui/common/snap_controls_to_pixels"));
|
||||||
|
}
|
||||||
|
|
||||||
void CanvasItemEditor::_notification(int p_what) {
|
void CanvasItemEditor::_notification(int p_what) {
|
||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_READY: {
|
case NOTIFICATION_READY: {
|
||||||
EditorRunBar::get_singleton()->connect("play_pressed", callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(true));
|
EditorRunBar::get_singleton()->connect("play_pressed", callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(true));
|
||||||
EditorRunBar::get_singleton()->connect("stop_pressed", callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(false));
|
EditorRunBar::get_singleton()->connect("stop_pressed", callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(false));
|
||||||
|
ProjectSettings::get_singleton()->connect("settings_changed", callable_mp(this, &CanvasItemEditor::_project_settings_changed));
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case NOTIFICATION_PROCESS: {
|
case NOTIFICATION_PROCESS: {
|
||||||
EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET("gui/common/snap_controls_to_pixels"));
|
|
||||||
|
|
||||||
int nb_having_pivot = 0;
|
int nb_having_pivot = 0;
|
||||||
|
|
||||||
// Update the viewport if the canvas_item changes
|
// Update the viewport if the canvas_item changes
|
||||||
|
|
|
@ -483,6 +483,8 @@ private:
|
||||||
void _focus_selection(int p_op);
|
void _focus_selection(int p_op);
|
||||||
void _reset_drag();
|
void _reset_drag();
|
||||||
|
|
||||||
|
void _project_settings_changed();
|
||||||
|
|
||||||
SnapTarget snap_target[2];
|
SnapTarget snap_target[2];
|
||||||
Transform2D snap_transform;
|
Transform2D snap_transform;
|
||||||
void _snap_if_closer_float(
|
void _snap_if_closer_float(
|
||||||
|
|
Loading…
Reference in a new issue