From a8865b17ee393523e79680b4ce1d0cc1cb090e9b Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 15 Jul 2015 20:05:12 +0200 Subject: [PATCH] Fix slightly uneven splits on shortcut due to handle size, though this will make previously saved layouts off by a few pixels (Steve Boddy, LP#1089162) --- terminatorlib/paned.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index dada8768..9c2514ee 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -390,10 +390,12 @@ class Paned(Container): self.set_position(self.get_position()) 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): - self.ratio = float(pos) / self.get_length() + handle_size = self.style_get_property('handle-size') + self.ratio = float(pos + (handle_size/2.0)) / self.get_length() self.set_pos(pos) class HPaned(Paned, gtk.HPaned):