1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks

This commit is contained in:
Rémi Verschelde
2021-05-04 14:41:06 +02:00
parent 64a63e0861
commit b5e1e05ef2
1439 changed files with 1 additions and 34187 deletions

View File

@@ -65,7 +65,6 @@ CurveEditor::CurveEditor() {
}
void CurveEditor::set_curve(Ref<Curve> curve) {
if (curve == _curve_ref)
return;
@@ -101,14 +100,11 @@ void CurveEditor::_notification(int p_what) {
}
void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb_ref = p_event;
if (mb_ref.is_valid()) {
const InputEventMouseButton &mb = **mb_ref;
if (mb.is_pressed() && !_dragging) {
Vector2 mpos = mb.get_position();
_selected_tangent = get_tangent_at(mpos);
@@ -134,7 +130,6 @@ void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) {
if (!mb.is_pressed() && _dragging && mb.get_button_index() == BUTTON_LEFT) {
_dragging = false;
if (_has_undo_data) {
UndoRedo &ur = *EditorNode::get_singleton()->get_undo_redo();
ur.create_action(_selected_tangent == TANGENT_NONE ? TTR("Modify Curve Point") : TTR("Modify Curve Tangent"));
@@ -151,13 +146,11 @@ void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseMotion> mm_ref = p_event;
if (mm_ref.is_valid()) {
const InputEventMouseMotion &mm = **mm_ref;
Vector2 mpos = mm.get_position();
if (_dragging && _curve_ref.is_valid()) {
if (_selected_point != -1) {
Curve &curve = **_curve_ref;
@@ -473,7 +466,6 @@ void CurveEditor::toggle_linear(TangentIndex tangent) {
tangent = _selected_tangent;
if (tangent == TANGENT_LEFT) {
bool is_linear = _curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR;
Curve::TangentMode prev_mode = _curve_ref->get_point_left_mode(_selected_point);
@@ -483,7 +475,6 @@ void CurveEditor::toggle_linear(TangentIndex tangent) {
ur.add_undo_method(*_curve_ref, "set_point_left_mode", _selected_point, prev_mode);
} else {
bool is_linear = _curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR;
Curve::TangentMode prev_mode = _curve_ref->get_point_right_mode(_selected_point);
@@ -538,7 +529,6 @@ void CurveEditor::update_view_transform() {
}
Vector2 CurveEditor::get_tangent_view_pos(int i, TangentIndex tangent) const {
Vector2 dir;
if (tangent == TANGENT_LEFT)
dir = -Vector2(1, _curve_ref->get_point_left_tangent(i));
@@ -562,7 +552,6 @@ Vector2 CurveEditor::get_world_pos(Vector2 view_pos) const {
// Uses non-baked points, but takes advantage of ordered iteration to be faster
template <typename T>
static void plot_curve_accurate(const Curve &curve, float step, T plot_func) {
if (curve.get_point_count() <= 1) {
// Not enough points to make a curve, so it's just a straight line
float y = curve.interpolate(0);
@@ -600,7 +589,6 @@ static void plot_curve_accurate(const Curve &curve, float step, T plot_func) {
}
struct CanvasItemPlotCurve {
CanvasItem &ci;
Color color1;
Color color2;
@@ -685,7 +673,6 @@ void CurveEditor::_draw() {
// Draw tangents for current point
if (_selected_point >= 0) {
const Color tangent_color = get_color("accent_color", "Editor");
int i = _selected_point;
@@ -757,12 +744,10 @@ void CurveEditor::_bind_methods() {
//---------------
bool EditorInspectorPluginCurve::can_handle(Object *p_object) {
return Object::cast_to<Curve>(p_object) != NULL;
}
void EditorInspectorPluginCurve::parse_begin(Object *p_object) {
Curve *curve = Object::cast_to<Curve>(p_object);
ERR_FAIL_COND(!curve);
Ref<Curve> c(curve);
@@ -788,7 +773,6 @@ bool CurvePreviewGenerator::handles(const String &p_type) const {
}
Ref<Texture> CurvePreviewGenerator::generate(const Ref<Resource> &p_from, const Size2 &p_size) const {
Ref<Curve> curve_ref = p_from;
ERR_FAIL_COND_V_MSG(curve_ref.is_null(), Ref<Texture>(), "It's not a reference to a valid Resource object.");
Curve &curve = **curve_ref;
@@ -816,7 +800,6 @@ Ref<Texture> CurvePreviewGenerator::generate(const Ref<Resource> &p_from, const
int prev_y = 0;
for (int x = 0; x < im.get_width(); ++x) {
float t = static_cast<float>(x) / im.get_width();
float v = (curve.interpolate_baked(t) - curve.get_min_value()) / range_y;
int y = CLAMP(im.get_height() - v * im.get_height(), 0, im.get_height());