svg-canvas-element.js 776 B

12345678910111213141516171819202122
  1. jvm.SVGCanvasElement = function(container, width, height){
  2. this.classPrefix = 'SVG';
  3. jvm.SVGCanvasElement.parentClass.call(this, 'svg');
  4. jvm.AbstractCanvasElement.apply(this, arguments);
  5. }
  6. jvm.inherits(jvm.SVGCanvasElement, jvm.SVGElement);
  7. jvm.mixin(jvm.SVGCanvasElement, jvm.AbstractCanvasElement);
  8. jvm.SVGCanvasElement.prototype.setSize = function(width, height){
  9. this.width = width;
  10. this.height = height;
  11. this.node.setAttribute('width', width);
  12. this.node.setAttribute('height', height);
  13. };
  14. jvm.SVGCanvasElement.prototype.applyTransformParams = function(scale, transX, transY) {
  15. this.scale = scale;
  16. this.transX = transX;
  17. this.transY = transY;
  18. this.rootElement.node.setAttribute('transform', 'scale('+scale+') translate('+transX+', '+transY+')');
  19. };