From a0b3c04206229450c7e6bd59db18ccbad189bb85 Mon Sep 17 00:00:00 2001 From: Louis Poirier Date: Wed, 2 Oct 2024 15:08:26 +0200 Subject: [PATCH] fix: scrolling to selected property in MEMORY view. --- scripts/cet/Controllers/MemoryController.lua | 6 +++++- scripts/cet/Views/MemoryView.lua | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/cet/Controllers/MemoryController.lua b/scripts/cet/Controllers/MemoryController.lua index 499b247..43177b2 100644 --- a/scripts/cet/Controllers/MemoryController.lua +++ b/scripts/cet/Controllers/MemoryController.lua @@ -135,7 +135,7 @@ function MemoryController:OnPropertySelected(property) self.property.selected = property self.property.needScroll = false if property ~= nil then - self.property.needScroll = true and self.property.selected == nil + self.property.needScroll = true self.selection.offset = property:GetOffset() self.selection.size = property:GetTypeSize() end @@ -303,6 +303,10 @@ function MemoryController:Select(offset) self:Emit("OffsetSelected", self.selection.offset) end +function MemoryController:ScrolledToProperty() + self.property.needScroll = false +end + function MemoryController:SubmitAddressForm() local form = self.addressForm diff --git a/scripts/cet/Views/MemoryView.lua b/scripts/cet/Views/MemoryView.lua index 2965cd0..eaa9ea0 100644 --- a/scripts/cet/Views/MemoryView.lua +++ b/scripts/cet/Views/MemoryView.lua @@ -121,7 +121,7 @@ function MemoryView:DrawFrame() color = self.theme.colors.hovered elseif Utils.IsInRange(offset, selection.offset, selection.size) then if self.property.needScroll then - self.property.needScroll = false + self:Call("ScrolledToProperty") ImGui.SetScrollHereY() end color = self.theme.colors.selected