Fix for slightly off-center splits.

This commit is contained in:
Stephen Boddy 2012-12-13 18:07:18 +01:00
parent ab6eae90e6
commit a6e72c1d63
1 changed files with 2 additions and 1 deletions

View File

@ -386,7 +386,8 @@ class Paned(Container):
self.set_position(self.get_position()) self.set_position(self.get_position())
def set_position_by_ratio(self): def set_position_by_ratio(self):
self.set_pos(int(self.ratio*self.get_length())) handle_size = self.style_get_property('handle-size')
self.set_pos(int((self.ratio*self.get_length())-(handle_size/2.0)))
def set_position(self, pos): def set_position(self, pos):
self.ratio = float(pos) / self.get_length() self.ratio = float(pos) / self.get_length()