Skip to content

Commit

Permalink
Scaled map to fit
Browse files Browse the repository at this point in the history
  • Loading branch information
teckel12 committed Sep 1, 2019
1 parent 8040967 commit 2bb0f1f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/nirvana.luac
Binary file not shown.
2 changes: 1 addition & 1 deletion src/iNav/nirvana.lua
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, ic

if data.gpsHome ~= false then
-- Craft location
tmp2 = config[31].v == 1 and 50 or 100
tmp2 = config[31].v == 1 and 65 or 130
d = data.distanceLast >= data.distRef and min(max(data.distanceLast / maxDist * tmp2, 7), tmp2) or 1
local bearing = calcBearing(data.gpsHome, data.gpsLatLon) - tmp
local rad1 = rad(bearing)
Expand Down

1 comment on commit 2bb0f1f

@bostontrucker
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -441,7 +441,7 @@ local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, ic

	if data.gpsHome ~= false then			if data.gpsHome ~= false then
		-- Craft location				-- Craft location
		tmp2 = config[31].v == 1 and 50 or 100				tmp2 = config[31].v == 1 and 65 or 130
		d = data.distanceLast >= data.distRef and min(max(data.distanceLast / maxDist * tmp2, 7), tmp2) or 1				d = data.distanceLast >= data.distRef and min(max(data.distanceLast / maxDist * tmp2, 7), tmp2) or 1
		local bearing = calcBearing(data.gpsHome, data.gpsLatLon) - tmp				local bearing = calcBearing(data.gpsHome, data.gpsLatLon) - tmp
		local rad1 = rad(bearing)				local rad1 = rad(bearing)
		cx = floor(sin(rad1) * d + 0.5)				cx = floor(sin(rad1) * d + 0.5)
		cy = floor(cos(rad1) * d + 0.5)				cy = floor(cos(rad1) * d + 0.5)
		-- Home position				-- Home position
		local hx = X_CNTR + 2				local hx = X_CNTR + 2
		local hy = Y_CNTR				local hy = Y_CNTR
		if config[31].v ~= 1 then				if config[31].v ~= 1 then
			hx = hx - (d > 9 and cx * 0.5 or 0)					hx = hx - (d > 9 and cx * 0.5 or 0)
			hy = hy + (d > 9 and cy * 0.5 or 0)					hy = hy + (d > 9 and cy * 0.5 or 0)
		end				end
		if d >= 12 then				if d >= 12 then
			--bmap(icons.home, hx - 4, hy - 5)					--bmap(icons.home, hx - 4, hy - 5)
			bmap(icons.home[1], hx - 8, hy - 10)					bmap(icons.home[1], hx - 8, hy - 10)
		elseif d > 1 then				elseif d > 1 then
			fill(hx - 1, hy - 1, 3, 3, SOLID)					fill(hx - 1, hy - 1, 3, 3, SOLID)
		end				end
		-- Shift craft location				-- Shift craft location
		cx = d == 1 and X_CNTR + 2 or cx + hx				cx = d == 1 and X_CNTR + 2 or cx + hx
		cy = d == 1 and Y_CNTR or hy - cy				cy = d == 1 and Y_CNTR or hy - cy
	else			else
		cx = X_CNTR + 2				cx = X_CNTR + 2

Please sign in to comment.