improved stroke-gedge intersection detection