[Commits] [wesnoth/wesnoth] e9c6df: Slider refactor

GitHub noreply at github.com
Sat Oct 28 23:13:50 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: e9c6dff56ad8283d19e539e27fde5ada6c73059c
      https://github.com/wesnoth/wesnoth/commit/e9c6dff56ad8283d19e539e27fde5ada6c73059c
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2017-10-29 (Sun, 29 Oct 2017)

  Changed paths:
    M projectfiles/VC12/wesnoth.vcxproj
    M source_lists/wesnoth
    M src/gui/dialogs/chat_log.cpp
    M src/gui/dialogs/editor/generator_settings.cpp
    M src/gui/dialogs/multiplayer/mp_options_helper.cpp
    M src/gui/dialogs/preferences_dialog.cpp
    M src/gui/widgets/integer_selector.hpp
    M src/gui/widgets/slider.cpp
    M src/gui/widgets/slider.hpp
    A src/gui/widgets/slider_base.cpp
    A src/gui/widgets/slider_base.hpp
    M src/utils/math.hpp

  Log Message:
  -----------
  Slider refactor

1) We now use a single function to set slider min/max value, this fixes #1641
   (sliders having a temporary invalid (min > max) state between set_min() and
   set_max() calls)
2) I split the sliders_base class from the scrollbar_base class to not
   accidently break the rather complicated scrollbar_base class while
   refactoring sliders.
3) We don't use floats in the slider code to make sure no rounding errors happen.
4) This fixes #1539 by removing slider::in_orthoginal (which made it impossible
   to pull a slider to its maximum/minimum) and intead clamping the mouse
   position in range.
5) This fixes #1656 and #1767 by refactoriung code (that bug happend mainly
   because the old code used variables that contained the position in 'steps'
   as pixel position and vice versa)
6) Sliders now 'snap' to the correct values just like the gui1 sliders did.
7) Slider positions are now poperly rounded to its neariest values
   instead of just beeing 'floored'


  Commit: b49c843ff5b49661d35457abcf5faf10cfffb037
      https://github.com/wesnoth/wesnoth/commit/b49c843ff5b49661d35457abcf5faf10cfffb037
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2017-10-29 (Sun, 29 Oct 2017)

  Changed paths:
    M src/gui/widgets/slider_base.cpp

  Log Message:
  -----------
  remove unneeded special case handling.


Compare: https://github.com/wesnoth/wesnoth/compare/7474c7f59931...b49c843ff5b4


More information about the Commits mailing list