Pure JavaScript Zoom and Pan, taken from http://phrogz.net/tmp/canvas_zoom_to_cursor.html
A Pen by TechSlides on CodePen.
| function createRoundedRectPath(x, y, width, height, radius) { | |
| return ( | |
| // Move to position, offset by radius in x direction | |
| "M" +(x + radius) + "," + y | |
| // Draw a horizontal line to the top right curve start | |
| + "h" + (width - 2 * radius) | |
| // Draw the top right corner curve | |
| + "a" + radius + "," + radius + " 0 0 1 " + radius + "," + radius | |
| // Draw a vertical line to the bottom right corner | |
| + "v" + (height - 2 * radius) |
Pure JavaScript Zoom and Pan, taken from http://phrogz.net/tmp/canvas_zoom_to_cursor.html
A Pen by TechSlides on CodePen.