[2.1.17] LuaRenderObject::dash_offset causes overextension when dash + gap > length
Posted: Fri Sep 04, 2026 3:52 pm
When gap_length and dash_length combined are larger than the actual length of the line, setting dash_offset to a higher value causes one of the dashes to overextend past the "to" target.
Reproduction:
Reproduction:
Code: Select all
/c
local surface = game.player.surface
local a = surface.create_entity{name = "wooden-chest", position = {0, 0}}
local b = surface.create_entity{name = "wooden-chest", position = {2, 0}}
local render = rendering.draw_line{color = {1, 1, 1}, width = 4, from = a, to = b, surface = surface, gap_length = 1, dash_length = 7}
script.on_event(defines.events.on_tick, function(event)
render.dash_offset = (event.tick % 120) / 120 * 8
end)