FIX processor dial placement for multiple rows
This commit is contained in:
parent
462006aa34
commit
7ea7c7cea5
|
@ -74,20 +74,15 @@ return function(update_freq, config, main_state, common, width, point)
|
||||||
local core_cols = ncores / config.core_rows
|
local core_cols = ncores / config.core_rows
|
||||||
local cores = {}
|
local cores = {}
|
||||||
for c = 1, ncores do
|
for c = 1, ncores do
|
||||||
local dial_x
|
local dial_x = point.x +
|
||||||
local dial_y
|
(core_cols == 1
|
||||||
if core_cols == 1 then
|
and (width / 2)
|
||||||
dial_x = point.x + width / 2
|
or (config.core_padding + DIAL_OUTER_RADIUS +
|
||||||
dial_y = y + DIAL_OUTER_RADIUS +
|
|
||||||
(2 * DIAL_OUTER_RADIUS + DIAL_SPACING) * (c - 1)
|
|
||||||
else
|
|
||||||
dial_x = point.x + config.core_padding + DIAL_OUTER_RADIUS +
|
|
||||||
(width - 2 * (DIAL_OUTER_RADIUS + config.core_padding))
|
(width - 2 * (DIAL_OUTER_RADIUS + config.core_padding))
|
||||||
* math.fmod(c - 1, core_cols) / (core_cols - 1)
|
* math.fmod(c - 1, core_cols) / (core_cols - 1)))
|
||||||
dial_y = y + DIAL_OUTER_RADIUS +
|
local dial_y = y + DIAL_OUTER_RADIUS +
|
||||||
(2 * DIAL_OUTER_RADIUS + DIAL_SPACING)
|
(2 * DIAL_OUTER_RADIUS + DIAL_SPACING)
|
||||||
* math.floor((c - 1) / core_cols) / (core_cols - 1)
|
* math.floor((c - 1) / core_cols)
|
||||||
end
|
|
||||||
cores[c] = create_core(dial_x, dial_y)
|
cores[c] = create_core(dial_x, dial_y)
|
||||||
end
|
end
|
||||||
local update = function()
|
local update = function()
|
||||||
|
|
Loading…
Reference in New Issue