electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 4195001aed9a5a307cbd83b19f9e66af390643b6
parent 1b0e29d385ccd62dbb55a47e768a32e5f0125358
Author: ThomasV <thomasv@electrum.org>
Date:   Thu, 10 Dec 2015 15:26:38 +0100

kivy: fix animate_to_center

Diffstat:
Mgui/kivy/uix/screens.py | 15++-------------
1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py @@ -380,20 +380,9 @@ class TabbedCarousel(Factory.TabbedPanel): scrlv = self._tab_strip.parent if not scrlv: return - idx = self.tab_list.index(value) - if idx == 0: - scroll_x = 1 - elif idx == len(self.tab_list) - 1: - scroll_x = 0 - else: - self_center_x = scrlv.center_x - vcenter_x = value.center_x - diff_x = (self_center_x - vcenter_x) - try: - scroll_x = scrlv.scroll_x - (diff_x / scrlv.width) - except ZeroDivisionError: - pass + n = len(self.tab_list) + scroll_x = 1. * (n - idx - 1) / (n - 1) mation = Factory.Animation(scroll_x=scroll_x, d=.25) mation.cancel_all(scrlv) mation.start(scrlv)