Created
November 3, 2014 18:50
-
-
Save mhkeller/fe0b80f6e1ac11facaaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function qBPath(sx, sy, tx, ty) { | |
var curve = ((tx-sx) * 0.05), | |
path = ""; | |
path += "Q " + (sx) + "," + (sy+curve) + " " + ((sx+tx)/2) +","+ ((sy+ty)/2); | |
path += "Q " + (tx) + "," + (ty-curve) + " " + tx + "," + ty; | |
return path; | |
} | |
path += 'M ' + source_left_offset + ',0' | |
path += qBPath(source_left_offset, 0, target_x - padding, baseline_y) | |
path += 'L ' + target_x + padding + ','+baseline_y; | |
path += qBPath(target_x + padding, baseline_y, source_right_offset, 0) | |
path += 'Z'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment