summaryrefslogtreecommitdiff
path: root/editor/pane_drag.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-05-14 23:09:03 +0200
committerGitHub <noreply@github.com>2020-05-14 23:09:03 +0200
commit00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8 (patch)
tree2b1c31f45add24085b64425ce440f577424c16a1 /editor/pane_drag.cpp
parent5046f666a1181675b39f156c38346525dc1c444e (diff)
parent0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (diff)
Merge pull request #38738 from akien-mga/cause-we-never-go-out-of-style
Style: Remove new line at block start, enforce line between functions, enforce braces in if and loop blocks
Diffstat (limited to 'editor/pane_drag.cpp')
-rw-r--r--editor/pane_drag.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/editor/pane_drag.cpp b/editor/pane_drag.cpp
index ce90fa94dc..09f2b90b90 100644
--- a/editor/pane_drag.cpp
+++ b/editor/pane_drag.cpp
@@ -31,23 +31,19 @@
#include "pane_drag.h"
void PaneDrag::_gui_input(const Ref<InputEvent> &p_input) {
-
Ref<InputEventMouseMotion> mm = p_input;
if (mm.is_valid() && mm->get_button_mask() & BUTTON_MASK_LEFT) {
-
emit_signal("dragged", Point2(mm->get_relative().x, mm->get_relative().y));
}
}
void PaneDrag::_notification(int p_what) {
-
switch (p_what) {
-
case NOTIFICATION_DRAW: {
-
Ref<Texture2D> icon = mouse_over ? get_theme_icon("PaneDragHover", "EditorIcons") : get_theme_icon("PaneDrag", "EditorIcons");
- if (!icon.is_null())
+ if (!icon.is_null()) {
icon->draw(get_canvas_item(), Point2(0, 0));
+ }
} break;
case NOTIFICATION_MOUSE_ENTER:
@@ -60,21 +56,20 @@ void PaneDrag::_notification(int p_what) {
break;
}
}
-Size2 PaneDrag::get_minimum_size() const {
+Size2 PaneDrag::get_minimum_size() const {
Ref<Texture2D> icon = get_theme_icon("PaneDrag", "EditorIcons");
- if (!icon.is_null())
+ if (!icon.is_null()) {
return icon->get_size();
+ }
return Size2();
}
void PaneDrag::_bind_methods() {
-
ClassDB::bind_method("_gui_input", &PaneDrag::_gui_input);
ADD_SIGNAL(MethodInfo("dragged", PropertyInfo(Variant::VECTOR2, "amount")));
}
PaneDrag::PaneDrag() {
-
mouse_over = false;
}