change to line gird from the grid of the rect

http://osc.matsukei.net/issues/351  fixes #351