New plan:
YIQYNVD2IG27E6DFAM4CYRA4ETIOGUGCBLBJR4FYE4WBEWPQQOMAC
BZRRUIFQQTGFJZH42H3LI4JX2GPCWVOKYF3HJQO7KNLHHHC7GAWQC
AMXTYDOFJ4MFLO5MKVSEL32FOKTFGCW3AURNDO5LUIMEVLD6QDNAC
YT5P6TO64XSMCZGTT4SVNFOWUN5ECNXTWCMFXN3YCDZUNH4H3IFAC
BPWFKBXTKIRBJFWVZIUVCHGJTLBCR6EIMEHM3D3KOF5IULXCR5RQC
CE4LZV4TNXJT54CVGM3QANCBP42TMLMZWF2DBSMUYKAHILXIZEMQC
J2SVGR2EQEROXDDMYZOCELD2VDYQALGZYRSZ4WGMTACAGMRPJ7UAC
6J3NXBYGADKVHD53QKHUZNRO2B52DC66Y6GQT5KEH6YKVYNCCRTAC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
K464QQR4FTXFUMHFWAGOD5DJ6YHUBUKRHLXF2ORE74DVT7TVQ35QC
ZUOL7X6VIPRCMEZURYGNHTDEIP3ZCHZW4PKVKBNXVZL5V4VOE5ZQC
end
function test_adjust_line_width()
io.write('\ntest_adjust_line_width')
Filename = 'foo'
App.screen.init{width=Margin_left+300, height=300}
Line_width = 256
App.draw() -- initialize button
App.run_after_mouse_press(256, Margin_top-3, 1)
App.mouse_move(200, 37)
-- no change for some time
App.wait_fake_time(0.01)
App.update(0)
check_eq(Line_width, 256, 'F - test_adjust_line_width/early')
-- after 0.1s the change takes
App.wait_fake_time(0.1)
App.update(0)
check_eq(Line_width, 200, 'F - test_adjust_line_width')
-- line-width indicator
button('line-width', {x=Line_width-4,y=Margin_top-10, w=10,h=10, color={1,1,1},
icon = icon.line_width,
onpress1 = function() Line_width_hover = App.getTime() end,
})
if Line_width_hover then
love.graphics.setColor(0.7,0.7,0.7)
love.graphics.line(Line_width,Margin_top+2, Line_width,App.screen.height)
end
end
end
-- update Line_width with some hysteresis while the indicator is dragged
if Line_width_hover then
if App.getTime() - Line_width_hover > 0.1 then
Line_width = App.mouse_x()
Text.redraw_all()
if App.mouse_down(1) then
Line_width_hover = App.getTime()
else
Line_width_hover = nil
end