From 55a19cd398cd51b83eb79f91e3c6c14f2a590240 Mon Sep 17 00:00:00 2001 From: Daniel Margarido Date: Tue, 28 Nov 2023 23:34:44 +0000 Subject: [PATCH] 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. --- data/core/rootview.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/core/rootview.lua b/data/core/rootview.lua index 18ae40ab..ec9d5e0e 100644 --- a/data/core/rootview.lua +++ b/data/core/rootview.lua @@ -313,10 +313,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) @@ -406,10 +406,10 @@ function RootView:on_touch_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)