[2.1.17] LuaRenderObject::dash_offset causes overextension when dash + gap > length

This subforum contains all the issues which we already resolved.
User avatar
_CodeGreen
Fast Inserter
Fast Inserter
Posts: 110
Joined: Sat Mar 05, 2022 11:30 am
Contact:

[2.1.17] LuaRenderObject::dash_offset causes overextension when dash + gap > length

Post by _CodeGreen »

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:

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)
render.gif
render.gif (25.21 MiB) Viewed 397 times
My Mods | If you can't make it perfect, make it adjustable
Rseding91
Factorio Staff
Factorio Staff
Posts: 17519
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.1.17] LuaRenderObject::dash_offset causes overextension when dash + gap > length

Post by Rseding91 »

Thanks for the report. You've now fixed this for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”