Skip to content

Commit

Permalink
fix: scrolling to selected property in MEMORY view.
Browse files Browse the repository at this point in the history
  • Loading branch information
poirierlouis committed Oct 2, 2024
1 parent b75b294 commit a0b3c04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scripts/cet/Controllers/MemoryController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scripts/cet/Views/MemoryView.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a0b3c04

Please sign in to comment.