From 054350263d30d0a0ba74a9f606268e45ef69c58c Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Sat, 20 Feb 2021 20:13:25 +0100 Subject: [PATCH] Fix treeview missing clamp bug Github issue: https://github.com/franko/lite-xl/issues/44 --- data/core/rootview.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/core/rootview.lua b/data/core/rootview.lua index f797c63..9c102d2 100644 --- a/data/core/rootview.lua +++ b/data/core/rootview.lua @@ -584,8 +584,10 @@ function RootView:on_mouse_moved(x, y, dx, dy) if self.dragged_divider then local node = self.dragged_divider if node.type == "hsplit" then + x = common.clamp(x, 0, self.root_node.size.x * 0.95) resize_child_node(node, "x", x, dx) elseif node.type == "vsplit" then + y = common.clamp(x, 0, self.root_node.size.y * 0.95) resize_child_node(node, "y", y, dy) end node.divider = common.clamp(node.divider, 0.01, 0.99)