Skip to content

Commit

Permalink
Fix treeview missing clamp bug
Browse files Browse the repository at this point in the history
Github issue: #44
  • Loading branch information
franko committed Feb 20, 2021
1 parent 4f2e38d commit 0543502
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/core/rootview.lua
Expand Up @@ -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)
Expand Down

0 comments on commit 0543502

Please sign in to comment.