summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-10-18 21:23:21 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-18 21:23:21 +0000
commit90e21f1637b604aa2e49b16c35f178dcccdec945 (patch)
treede941bc3c1e3e44a48bdcc93feb03cf5b5ad1789 /legacy
parent2db55269f67727c50f709f65c69686e68103136b (diff)
ephysics: don't set density 0 when setting mass on
sandbox SVN revision: 78203
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ephysics/src/bin/ephysics_sandbox.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/legacy/ephysics/src/bin/ephysics_sandbox.c b/legacy/ephysics/src/bin/ephysics_sandbox.c
index ccbbd6bc12..e0da0f37b5 100644
--- a/legacy/ephysics/src/bin/ephysics_sandbox.c
+++ b/legacy/ephysics/src/bin/ephysics_sandbox.c
@@ -209,8 +209,10 @@ static void
209_mass_set_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__) 209_mass_set_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
210{ 210{
211 Body_Data *bd = data; 211 Body_Data *bd = data;
212 ephysics_body_mass_set(bd->body, elm_slider_value_get(obj)); 212 double mass = elm_slider_value_get(obj);
213 elm_slider_value_set(evas_object_data_get(obj, "density"), 0); 213 ephysics_body_mass_set(bd->body, mass);
214 elm_slider_value_set(evas_object_data_get(obj, "density"),
215 mass / ephysics_body_volume_get(bd->body));
214} 216}
215 217
216static void 218static void