fix splitting tabs without dragging

This commit is contained in:
takase1121 2021-09-01 14:36:00 +08:00
parent 062e588fde
commit fb574eabbd
No known key found for this signature in database
GPG Key ID: 60EEFFC68EB3031B
1 changed files with 2 additions and 2 deletions

View File

@ -804,8 +804,8 @@ function RootView:on_mouse_released(button, x, y)
self.dragged_divider = nil
end
if self.dragged_node then
local _, _, _, h = Node.get_tab_rect(self.dragged_node[1], self.dragged_node[2])
if x < 0 or x > self.size.x or y < 0 or y > h then
local ox, oy = self:get_content_offset()
if x < ox or x > self.size.x or y < oy or y > self.size.y then
local tab = self.dragged_node[1].views[self.dragged_node[2]]
if tab:is(DocView) then
local filename = tab.doc.abs_filename or tab.doc.filename or "unsaved"