Fixed: Line displayed out of viewport in several cases.
Added extra samples.
Resolved several line positioning issues. Minor code refactoring.