Fixed issue with set_target_size passing the wrong value to plugins (#1657)

* Fixed issue with set_target_size passing the wrong value to plugins that are split on the right and activated from the settings UI.

* Added position awareness for the all resize_child_node calls.
This commit is contained in:
Daniel Margarido 2023-11-28 23:34:44 +00:00 committed by takase1121
parent 01cab0611c
commit 35ef0a9484
No known key found for this signature in database
GPG Key ID: 60EEFFC68EB3031B
1 changed files with 2 additions and 2 deletions

View File

@ -259,10 +259,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)
x = common.clamp(x - node.position.x, 0, self.root_node.size.x * 0.95)
resize_child_node(node, "x", x, dx)
elseif node.type == "vsplit" then
y = common.clamp(y, 0, self.root_node.size.y * 0.95)
y = common.clamp(y - node.position.y, 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)