VMLDrawing.js revision 828c58761d90445b8b9d20a82d85dc1479317f71
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncY.log('using VML');
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncvar Y_LANG = Y.Lang,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync IS_NUM = Y_LANG.isNumber,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync IS_ARRAY = Y_LANG.isArray,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync Y_DOM = Y.DOM,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync Y_SELECTOR = Y.Selector,
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync AttributeLite = Y.AttributeLite,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync PluginHost = Y.Plugin.Host,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync VMLShape,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync VMLCircle,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync VMLPath,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync VMLRect,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync VMLEllipse,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync VMLGraphic;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncfunction VMLDrawing() {}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncVMLDrawing.prototype = {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @private
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync _currentX: 0,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @private
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync _currentY: 0,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Draws a bezier curve.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @method curveTo
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} cp1x x-coordinate for the first control point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} cp1y y-coordinate for the first control point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} cp2x x-coordinate for the second control point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} cp2y y-coordinate for the second control point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} x x-coordinate for the end point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} y y-coordinate for the end point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync curveTo: function(cp1x, cp1y, cp2x, cp2y, x, y) {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync var hiX,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync loX,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync hiY,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync loY;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync x = Math.round(x);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync y = Math.round(y);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._path += ' c ' + Math.round(cp1x) + ", " + Math.round(cp1y) + ", " + Math.round(cp2x) + ", " + Math.round(cp2y) + ", " + x + ", " + y;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._currentX = x;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._currentY = y;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync hiX = Math.max(x, Math.max(cp1x, cp2x));
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync hiY = Math.max(y, Math.max(cp1y, cp2y));
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync loX = Math.min(x, Math.min(cp1x, cp2x));
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync loY = Math.min(y, Math.min(cp1y, cp2y));
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._trackSize(hiX, hiY);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._trackSize(loX, loY);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync },
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Draws a quadratic bezier curve.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @method quadraticCurveTo
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * @param {Number} cpx x-coordinate for the control point.
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * @param {Number} cpy y-coordinate for the control point.
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * @param {Number} x x-coordinate for the end point.
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * @param {Number} y y-coordinate for the end point.
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync */
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync quadraticCurveTo: function(cpx, cpy, x, y) {
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync var currentX = this._currentX,
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync currentY = this._currentY,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync cp1x = currentX + 0.67*(cpx - currentX),
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync cp1y = currentY + 0.67*(cpy - currentY),
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync cp2x = cp1x + (x - currentX) * 0.34,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync cp2y = cp1y + (y - currentY) * 0.34;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.curveTo(cp1x, cp1y, cp2x, cp2y, x, y);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync },
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Draws a rectangle.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @method drawRect
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} x x-coordinate
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} y y-coordinate
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} w width
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} h height
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync drawRect: function(x, y, w, h) {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.moveTo(x, y);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.lineTo(x + w, y);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.lineTo(x + w, y + h);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.lineTo(x, y + h);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.lineTo(x, y);
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync this._currentX = x;
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync this._currentY = y;
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync return this;
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync },
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync /**
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * Draws a rectangle with rounded corners.
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync *
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * @method drawRect
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * @param {Number} x x-coordinate
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} y y-coordinate
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} w width
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} h height
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} ew width of the ellipse used to draw the rounded corners
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} eh height of the ellipse used to draw the rounded corners
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync drawRoundRect: function(x, y, w, h, ew, eh) {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.moveTo(x, y + eh);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.lineTo(x, y + h - eh);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.quadraticCurveTo(x, y + h, x + ew, y + h);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.lineTo(x + w - ew, y + h);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.lineTo(x + w, y + eh);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.quadraticCurveTo(x + w, y, x + w - ew, y);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.lineTo(x + ew, y);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this.quadraticCurveTo(x, y, x, y + eh);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return this;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync },
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Draws a wedge.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} x x-coordinate of the wedge's center point
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * @param {Number} y y-coordinate of the wedge's center point
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} startAngle starting angle in degrees
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} arc sweep of the wedge. Negative values draw clockwise.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} yRadius [optional] y radius for wedge.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync drawWedge: function(x, y, startAngle, arc, radius, yRadius)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync var diameter = radius * 2;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync yRadius = yRadius || radius;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._path += this._getWedgePath({x:x, y:y, startAngle:startAngle, arc:arc, radius:radius, yRadius:yRadius});
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._trackSize(diameter, diameter);
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync this._currentX = x;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._currentY = y;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return this;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync },
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Generates a path string for a wedge shape
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @method _getWedgePath
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Object} config attributes used to create the path
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @return String
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @private
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync _getWedgePath: function(config)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync var x = config.x,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync y = config.y,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync startAngle = config.startAngle,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync arc = config.arc,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync radius = config.radius,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync yRadius = config.yRadius || radius,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync path;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if(Math.abs(arc) > 360)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync arc = 360;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync startAngle *= -65535;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync arc *= 65536;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync path = " m " + x + " " + y + " ae " + x + " " + y + " " + radius + " " + yRadius + " " + startAngle + " " + arc;
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync return path;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync },
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Completes a drawing operation.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @method end
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync end: function() {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._draw();
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync },
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @method lineTo
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} point1 x-coordinate for the end point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} point2 y-coordinate for the end point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync lineTo: function(point1, point2, etc) {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync var args = arguments,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync i,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync len;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (typeof point1 === 'string' || typeof point1 === 'number') {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync args = [[point1, point2]];
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync len = args.length;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if(!this._path)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._path = "";
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._path += ' l ';
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync for (i = 0; i < len; ++i) {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._path += ' ' + Math.round(args[i][0]) + ', ' + Math.round(args[i][1]);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._trackSize.apply(this, args[i]);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._currentX = args[i][0];
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._currentY = args[i][1];
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return this;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync },
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Moves the current drawing position to specified x and y coordinates.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @method moveTo
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} x x-coordinate for the end point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} y y-coordinate for the end point.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync moveTo: function(x, y) {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if(!this._path)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._path = "";
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._path += ' m ' + Math.round(x) + ', ' + Math.round(y);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._trackSize(x, y);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._currentX = x;
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync this._currentY = y;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync },
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Updates the size of the graphics object
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @method _trackSize
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} w width
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @param {Number} h height
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @private
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync _trackSize: function(w, h) {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync var wid = this._width || 0,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync ht = this._height || 0;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (w > wid) {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._width = w;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (h > ht) {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this._height = h;
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync};
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncY.VMLDrawing = VMLDrawing;
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync