vml-circle-element.js 820 B

1234567891011121314151617181920212223242526
  1. jvm.VMLCircleElement = function(config, style){
  2. jvm.VMLCircleElement.parentClass.call(this, 'oval', config, style);
  3. };
  4. jvm.inherits(jvm.VMLCircleElement, jvm.VMLShapeElement);
  5. jvm.VMLCircleElement.prototype.applyAttr = function(attr, value){
  6. switch (attr) {
  7. case 'r':
  8. this.node.style.width = value*2+'px';
  9. this.node.style.height = value*2+'px';
  10. this.applyAttr('cx', this.get('cx') || 0);
  11. this.applyAttr('cy', this.get('cy') || 0);
  12. break;
  13. case 'cx':
  14. if (!value) return;
  15. this.node.style.left = value - (this.get('r') || 0) + 'px';
  16. break;
  17. case 'cy':
  18. if (!value) return;
  19. this.node.style.top = value - (this.get('r') || 0) + 'px';
  20. break;
  21. default:
  22. jvm.VMLCircleElement.parentClass.prototype.applyAttr.call(this, attr, value);
  23. }
  24. };