Skip to content

Commit e3edabf

Browse files
author
arch
committed
more fixes for new lua api
1 parent 7893a93 commit e3edabf

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

contrib/Installer/assets/main.lua

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ end
182182

183183
function align_bottom_points(align_value)
184184
local script = ofs.Script(ofs.ActiveIdx())
185+
script:sort()
185186

186187
-- get min value in selection if no align_value was given
187188
if align_value < 0 then
@@ -195,19 +196,21 @@ function align_bottom_points(align_value)
195196
end
196197
end
197198

199+
print('align bottom points to', align_value)
200+
198201
-- align bottom points
199202
for idx, action in ipairs(script.actions) do
200203
if action.selected then
201204
local bottom_point = true
202205

203-
local next_action, _ = script:closestActionAfter(action.at / 1000)
206+
local next_action, _ = script:closestActionAfter(action.at)
204207
if next_action then
205208
if next_action.pos <= action.pos then
206209
bottom_point = false
207210
end
208211
end
209212

210-
local prev_action, _ = script:closestActionBefore(action.at / 1000)
213+
local prev_action, _ = script:closestActionBefore(action.at)
211214
if prev_action then
212215
if prev_action.pos <= action.pos then
213216
bottom_point = false
@@ -226,6 +229,7 @@ end
226229

227230
function align_top_points(align_value)
228231
local script = ofs.Script(ofs.ActiveIdx())
232+
script:sort()
229233

230234
-- get max value in selection if no align_value was given
231235
if align_value < 0 then
@@ -239,19 +243,21 @@ function align_top_points(align_value)
239243
end
240244
end
241245

246+
print('align top points to', align_value)
247+
242248
-- align top points
243249
for idx, action in ipairs(script.actions) do
244250
if action.selected then
245251
local top_point = true
246252

247-
local next_action, _ = script:closestActionAfter(action.at / 1000)
253+
local next_action, _ = script:closestActionAfter(action.at)
248254
if next_action then
249255
if next_action.pos >= action.pos then
250256
top_point = false
251257
end
252258
end
253259

254-
local prev_action, _ = script:closestActionBefore(action.at / 1000)
260+
local prev_action, _ = script:closestActionBefore(action.at)
255261
if prev_action then
256262
if prev_action.pos >= action.pos then
257263
top_point = false
@@ -430,7 +436,7 @@ function gui()
430436

431437
ofs.Separator()
432438

433-
local enable_post_processing = false -- broken
439+
local enable_post_processing = true
434440
if enable_post_processing then
435441
ofs.Text("Post-Processing:")
436442
ofs.SameLine()

0 commit comments

Comments
 (0)