correct location of the line width slider
This commit is contained in:
parent
97bbc7da7f
commit
c15ee0b4a0
4
main.lua
4
main.lua
|
@ -222,7 +222,7 @@ function App.draw()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- line-width indicator
|
-- line-width indicator
|
||||||
button('line-width', {x=Margin_left+Line_width-4,y=Margin_top-10, w=10,h=10, color={1,1,1},
|
button('line-width', {x=Line_width-4,y=Margin_top-10, w=10,h=10, color={1,1,1},
|
||||||
icon = icon.line_width,
|
icon = icon.line_width,
|
||||||
onpress1 = function() Line_width_hover = App.getTime() end,
|
onpress1 = function() Line_width_hover = App.getTime() end,
|
||||||
})
|
})
|
||||||
|
@ -295,7 +295,7 @@ function App.update(dt)
|
||||||
-- update Line_width with some hysteresis while the indicator is dragged
|
-- update Line_width with some hysteresis while the indicator is dragged
|
||||||
if Line_width_hover then
|
if Line_width_hover then
|
||||||
if App.getTime() - Line_width_hover > 0.1 then
|
if App.getTime() - Line_width_hover > 0.1 then
|
||||||
Line_width = App.mouse_x() - Margin_left
|
Line_width = App.mouse_x()
|
||||||
Text.redraw_all()
|
Text.redraw_all()
|
||||||
if App.mouse_down(1) then
|
if App.mouse_down(1) then
|
||||||
Line_width_hover = App.getTime()
|
Line_width_hover = App.getTime()
|
||||||
|
|
|
@ -16,8 +16,8 @@ function test_adjust_line_width()
|
||||||
App.screen.init{width=Margin_left+300, height=300}
|
App.screen.init{width=Margin_left+300, height=300}
|
||||||
Line_width = 256
|
Line_width = 256
|
||||||
App.draw() -- initialize button
|
App.draw() -- initialize button
|
||||||
App.run_after_mouse_press(Margin_left+256, Margin_top-3, 1)
|
App.run_after_mouse_press(256, Margin_top-3, 1)
|
||||||
App.mouse_move(Margin_left+200, 37)
|
App.mouse_move(200, 37)
|
||||||
-- no change for some time
|
-- no change for some time
|
||||||
App.wait_fake_time(0.01)
|
App.wait_fake_time(0.01)
|
||||||
App.update(0)
|
App.update(0)
|
||||||
|
|
1
text.lua
1
text.lua
|
@ -14,6 +14,7 @@ require 'text_tests'
|
||||||
function Text.draw(line, line_width, line_index)
|
function Text.draw(line, line_width, line_index)
|
||||||
--? print('text.draw', line_index)
|
--? print('text.draw', line_index)
|
||||||
love.graphics.setColor(0,0,0)
|
love.graphics.setColor(0,0,0)
|
||||||
|
--? love.graphics.line(Line_width,0, Line_width,App.screen.height)
|
||||||
-- wrap long lines
|
-- wrap long lines
|
||||||
local x = Margin_left
|
local x = Margin_left
|
||||||
local y = line.y
|
local y = line.y
|
||||||
|
|
Loading…
Reference in New Issue