Skip to content

Commit 92f66e8

Browse files
committed
fixup! fixup! (ui.target-scanner): clip width to size of timerwindow
1 parent ca26b81 commit 92f66e8

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

data/pigui/modules/flight-ui/target-scanner.lua

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ local function displayTargetScanner(min, max)
104104
local height = (ui.gauge_height * 1.4) * 2 + textHeight * 3 + headingHeight + ui.gauge_height * 0.5
105105

106106
local pos, size = ui.rectcut(min, max, height, ui.sides.bottom)
107-
if ui.timeWindowSize and size.x > ui.timeWindowSize.x then
108-
pos.x = pos.x + (size.x - ui.timeWindowSize.x)
109-
size.x = ui.timeWindowSize.x
110-
end
111107

112108
ui.setNextWindowPos(pos, "Always")
113109
ui.setNextWindowSize(size, "Always")
@@ -133,11 +129,6 @@ local function displayCloudScanner(min, max)
133129
+ ui.getItemSpacing().y
134130

135131
local pos, size = ui.rectcut(min, max, height, ui.sides.bottom)
136-
if ui.timeWindowSize and size.x > ui.timeWindowSize.x then
137-
pos.x = pos.x + (size.x - ui.timeWindowSize.x)
138-
size.x = ui.timeWindowSize.x
139-
end
140-
141132

142133
ui.setNextWindowPos(pos, "Always")
143134
ui.setNextWindowSize(size, "Always")
@@ -180,6 +171,10 @@ gameView.registerHudModule('target-scanner', {
180171
colors = ui.theme.colors
181172
icons = ui.theme.icons
182173
player = gameView.player
174+
-- restrict this HUD module to the width of the time window
175+
if ui.timeWindowSize then
176+
min.x = math.max(min.x, max.x - ui.timeWindowSize.x)
177+
end
183178
displayTargetScanner(min, max)
184179
end
185180
})
@@ -192,6 +187,10 @@ gameView.registerHudModule('hyperspacecloud-scanner', {
192187
colors = ui.theme.colors
193188
icons = ui.theme.icons
194189
player = gameView.player
190+
-- restrict this HUD module to the width of the time window
191+
if ui.timeWindowSize then
192+
min.x = math.max(min.x, max.x - ui.timeWindowSize.x)
193+
end
195194
displayCloudScanner(min, max)
196195
end
197196
})

0 commit comments

Comments
 (0)