From f62961aba3d9e11d4741649a591217796151a46c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 27 May 2015 17:30:50 -0300 Subject: [PATCH] -fix bug in animation editor -fix crash bug in physics motion, closes #1993 --- demos/2d/motion/engine.cfg | 7 +++++++ servers/physics_2d/physics_2d_server_wrap_mt.h | 2 +- tools/editor/animation_editor.cpp | 10 +++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/demos/2d/motion/engine.cfg b/demos/2d/motion/engine.cfg index 064de6b331e..261111904ce 100644 --- a/demos/2d/motion/engine.cfg +++ b/demos/2d/motion/engine.cfg @@ -2,3 +2,10 @@ name="Motion Test" main_scene="res://motion.scn" + +[display] + +width=800 +height=600 +stretch_mode="2d" +stretch_aspect="keep" diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.h b/servers/physics_2d/physics_2d_server_wrap_mt.h index 48382498efd..0ddc8f16ec4 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.h +++ b/servers/physics_2d/physics_2d_server_wrap_mt.h @@ -224,7 +224,7 @@ public: bool body_test_motion(RID p_body,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL) { ERR_FAIL_COND_V(main_thread!=Thread::get_caller_ID(),false); - return body_test_motion(p_body,p_motion,p_margin,r_result); + return physics_2d_server->body_test_motion(p_body,p_motion,p_margin,r_result); } /* JOINT API */ diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index 36fb6fb5f82..bb6f7e9a6f7 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -1327,8 +1327,16 @@ void AnimationKeyEditor::_track_editor_draw() { float time = animation->track_get_key_time(idx,i); if (timekeys_to) + if (time>keys_to) { + + if (first && i>0 && animation->track_get_key_value(idx,i)==animation->track_get_key_value(idx,i-1)) { + //draw whole line + te->draw_line(ofs+Vector2(name_limit,y+h/2),ofs+Point2(settings_limit,y+h/2),color); + } + break; + } + float x = key_hofs + name_limit + (time-keys_from)*zoom_scale; Ref tex = type_icon[tt];