Skip to content

Commit

Permalink
HUD home direction indicator limits top and bottom position so the ic…
Browse files Browse the repository at this point in the history
…on is visible at extreme angles
  • Loading branch information
teckel12 committed Aug 14, 2019
1 parent 4a0a126 commit 301931c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/horus.luac
Binary file not shown.
8 changes: 7 additions & 1 deletion src/iNav/horus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,15 @@ local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, ic
--local p = sin(rad(d * max(15 + (pitch - 90) * 0.5, 0))) * (upsideDown and DEGV or -DEGV)
local x = (X_CNTR - cos(roll1) * p) + (sin(roll1) * (h - X_CNTR)) - 9
local y = ((Y_CNTR - cos(rad(pitch)) * DEGV) - sin(roll1) * p) - (cos(roll1) * (h - X_CNTR)) - 9
if x >= 0 and y > 0 and x < RIGHT_POS - 17 and y < BOTTOM - 17 then
if x >= 0 and x < RIGHT_POS - 17 then
local s = floor(d * 2 + 0.5)
bmap(icons.home[s], x, min(max(y, s == 2 and 20 or 15), BOTTOM - (s == 2 and 35 or 30)))
end
--[[
if x >= 0 and y >= TOP and x < RIGHT_POS - 17 and y < BOTTOM - 17 then
bmap(icons.home[floor(d * 2 + 0.5)], x, y)
end
]]
else
-- Bottom-fixed method
local home = floor(((bearing - data.heading + (361 + HEADING_DEG * 0.5)) % 360) * PIXEL_DEG - 2.5)
Expand Down

0 comments on commit 301931c

Please sign in to comment.