1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-16 14:00:40 +00:00

Bring that Whole New World to the Old Continent too

Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
Rémi Verschelde
2017-03-19 00:36:26 +01:00
parent 1d418afe86
commit f8db8a3faa
1308 changed files with 147754 additions and 174357 deletions

View File

@@ -28,48 +28,50 @@
/*************************************************************************/
#include "pane_drag.h"
void PaneDrag::_input_event(const InputEvent &p_input) {
void PaneDrag::_input_event(const InputEvent& p_input) {
if (p_input.type == InputEvent::MOUSE_MOTION && p_input.mouse_motion.button_mask & BUTTON_MASK_LEFT) {
if (p_input.type==InputEvent::MOUSE_MOTION && p_input.mouse_motion.button_mask&BUTTON_MASK_LEFT) {
emit_signal("dragged",Point2(p_input.mouse_motion.relative_x,p_input.mouse_motion.relative_y));
emit_signal("dragged", Point2(p_input.mouse_motion.relative_x, p_input.mouse_motion.relative_y));
}
}
void PaneDrag::_notification(int p_what) {
switch(p_what) {
switch (p_what) {
case NOTIFICATION_DRAW: {
Ref<Texture> icon = mouse_over?get_icon("PaneDragHover","EditorIcons"):get_icon("PaneDrag","EditorIcons");
Ref<Texture> icon = mouse_over ? get_icon("PaneDragHover", "EditorIcons") : get_icon("PaneDrag", "EditorIcons");
if (!icon.is_null())
icon->draw(get_canvas_item(),Point2(0,0));
icon->draw(get_canvas_item(), Point2(0, 0));
} break;
case NOTIFICATION_MOUSE_ENTER: mouse_over=true; update(); break;
case NOTIFICATION_MOUSE_EXIT: mouse_over=false; update(); break;
case NOTIFICATION_MOUSE_ENTER:
mouse_over = true;
update();
break;
case NOTIFICATION_MOUSE_EXIT:
mouse_over = false;
update();
break;
}
}
Size2 PaneDrag::get_minimum_size() const {
Ref<Texture> icon=get_icon("PaneDrag","EditorIcons");
Ref<Texture> icon = get_icon("PaneDrag", "EditorIcons");
if (!icon.is_null())
return icon->get_size();
return Size2();
}
void PaneDrag::_bind_methods() {
ObjectTypeDB::bind_method("_input_event",&PaneDrag::_input_event);
ADD_SIGNAL(MethodInfo("dragged",PropertyInfo(Variant::VECTOR2,"amount")));
ObjectTypeDB::bind_method("_input_event", &PaneDrag::_input_event);
ADD_SIGNAL(MethodInfo("dragged", PropertyInfo(Variant::VECTOR2, "amount")));
}
PaneDrag::PaneDrag() {
mouse_over=false;
mouse_over = false;
}