feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -57,7 +57,7 @@ int GradientEdit::_get_point_at(int p_xpos) const {
|
|||
break;
|
||||
}
|
||||
// Check if we clicked at point.
|
||||
float distance = ABS(p_xpos - gradient->get_offset(i) * total_w);
|
||||
float distance = Math::abs(p_xpos - gradient->get_offset(i) * total_w);
|
||||
if (distance < min_distance) {
|
||||
result = i;
|
||||
min_distance = distance;
|
||||
|
|
@ -385,14 +385,14 @@ void GradientEdit::gui_input(const Ref<InputEvent> &p_event) {
|
|||
int nearest_idx = -1;
|
||||
// Only check the two adjacent points to find which one is the nearest.
|
||||
if (selected_index > 0) {
|
||||
float temp_offset = ABS(gradient->get_offset(selected_index - 1) - new_offset);
|
||||
float temp_offset = Math::abs(gradient->get_offset(selected_index - 1) - new_offset);
|
||||
if (temp_offset < smallest_offset) {
|
||||
smallest_offset = temp_offset;
|
||||
nearest_idx = selected_index - 1;
|
||||
}
|
||||
}
|
||||
if (selected_index < gradient->get_point_count() - 1) {
|
||||
float temp_offset = ABS(gradient->get_offset(selected_index + 1) - new_offset);
|
||||
float temp_offset = Math::abs(gradient->get_offset(selected_index + 1) - new_offset);
|
||||
if (temp_offset < smallest_offset) {
|
||||
smallest_offset = temp_offset;
|
||||
nearest_idx = selected_index + 1;
|
||||
|
|
@ -544,6 +544,14 @@ void GradientEdit::_notification(int p_what) {
|
|||
draw_spacing = BASE_SPACING * get_theme_default_base_scale();
|
||||
handle_width = BASE_HANDLE_WIDTH * get_theme_default_base_scale();
|
||||
} break;
|
||||
case NOTIFICATION_ACCESSIBILITY_UPDATE: {
|
||||
RID ae = get_accessibility_element();
|
||||
ERR_FAIL_COND(ae.is_null());
|
||||
|
||||
//TODO
|
||||
DisplayServer::get_singleton()->accessibility_update_set_role(ae, DisplayServer::AccessibilityRole::ROLE_STATIC_TEXT);
|
||||
DisplayServer::get_singleton()->accessibility_update_set_value(ae, TTR(vformat("The %s is not accessible at this time.", "Gradient editor")));
|
||||
} break;
|
||||
case NOTIFICATION_DRAW: {
|
||||
_redraw();
|
||||
} break;
|
||||
|
|
@ -630,6 +638,7 @@ GradientEditor::GradientEditor() {
|
|||
|
||||
snap_button = memnew(Button);
|
||||
snap_button->set_tooltip_text(TTR("Toggle Grid Snap"));
|
||||
snap_button->set_accessibility_name(TTRC("Snap to Grid"));
|
||||
snap_button->set_toggle_mode(true);
|
||||
toolbar->add_child(snap_button);
|
||||
snap_button->connect(SceneStringName(toggled), callable_mp(this, &GradientEditor::_set_snap_enabled));
|
||||
|
|
@ -637,6 +646,7 @@ GradientEditor::GradientEditor() {
|
|||
snap_count_edit = memnew(EditorSpinSlider);
|
||||
snap_count_edit->set_min(2);
|
||||
snap_count_edit->set_max(100);
|
||||
snap_count_edit->set_accessibility_name(TTRC("Grid Step"));
|
||||
snap_count_edit->set_value(DEFAULT_SNAP);
|
||||
snap_count_edit->set_custom_minimum_size(Size2(65 * EDSCALE, 0));
|
||||
toolbar->add_child(snap_count_edit);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue