Reduce sync scrolling precision

High precision leads to micro-scrolling, and 1e-4 is more than enough.
github/fork/yochananmarqos/patch-1
Gonçalo Silva 2019-06-13 03:57:36 +01:00
parent 55d82856c2
commit 3fa56afaef
1 changed files with 2 additions and 2 deletions

View File

@ -150,12 +150,12 @@ class PreviewHandler:
self.__show(step=Step.RENDER)
def on_text_view_scrolled(self, _text_view, scale):
if self.shown and not math.isclose(scale, self.web_view.get_scroll_scale(), rel_tol=1e-5):
if self.shown and not math.isclose(scale, self.web_view.get_scroll_scale(), rel_tol=1e-4):
self.web_view.set_scroll_scale(scale)
def on_web_view_scrolled(self, _web_view, scale):
if self.shown and self.text_view.get_mapped() and \
not math.isclose(scale, self.text_view.get_scroll_scale(), rel_tol=1e-5):
not math.isclose(scale, self.text_view.get_scroll_scale(), rel_tol=1e-4):
self.text_view.set_scroll_scale(scale)
@staticmethod