diff options
author | Stijn Buys <ingar@osirion.org> | 2010-11-29 16:22:32 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-11-29 16:22:32 +0000 |
commit | c157f244c1d25fcc5b76c5f73767e2f64cc13afe (patch) | |
tree | f3def2c79395b0bd636591f31d7087b205e185c3 | |
parent | 8774e65cc503318005f34c133cbaee21b18fc144 (diff) |
Improved ui::ModelView scaling.
-rwxr-xr-x | src/ui/modelview.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ui/modelview.cc b/src/ui/modelview.cc index dc6ddfc..0b01fb2 100755 --- a/src/ui/modelview.cc +++ b/src/ui/modelview.cc @@ -25,6 +25,7 @@ ModelView::ModelView(Widget *parent, const char *modelname) : Widget(parent) set_modelname(modelname); + modelview_radius = 0.75f; modelview_zoom = 1.0f; modelview_dragging = false; @@ -55,7 +56,6 @@ void ModelView::set_modelname(const char *modelname) modelview_axis.change_direction(180); modelview_axis.change_pitch(-15); modelview_zoom = 1.0f; - modelview_radius = 0.75f; } void ModelView::set_color(const math::Color & color) @@ -66,20 +66,20 @@ void ModelView::set_color(const math::Color & color) void ModelView::set_zoom(const float zoom) { modelview_zoom = zoom; - math::clamp(modelview_zoom, 1.0f, 10.0f); + math::clamp(modelview_zoom, 1.0f, 5.0f); } bool ModelView::on_keypress(const int key, const unsigned int modifier) { if (key == 512 + SDL_BUTTON_WHEELUP) { - modelview_zoom -= 0.5f; + modelview_zoom -= 0.25f; if (modelview_zoom < 1.0f) modelview_zoom = 1.0f; return true; } else if (key == 512 + SDL_BUTTON_WHEELDOWN) { - modelview_zoom += 0.5f; - if (modelview_zoom > 10.0f) - modelview_zoom = 10.0f; + modelview_zoom += 0.25f; + if (modelview_zoom > 5.0f) + modelview_zoom = 5.0f; return true; } else if (key == 512 + SDL_BUTTON_LEFT) { modelview_dragging = true; |