Roo/svg/Canvas.js
authorAlan Knowles <alan@roojs.com>
Fri, 25 Jun 2021 07:33:58 +0000 (15:33 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 25 Jun 2021 07:33:58 +0000 (15:33 +0800)
Roo/svg/Canvas.js

index 95526d4..78d6d53 100644 (file)
@@ -97,7 +97,8 @@ Roo.extend(Roo.svg.Canvas, Roo.bootstrap.Component,  {
     
     updateViewBox: function()
     {
-        this.el.attr("viewBox", this.viewBox.x + " " + this.viewBox.y + " " + this.viewBox.w + " " + this.viewBox.h);
+        var box = this.el.dom.getBBox()
+        this.el.attr("viewBox", box.x + " " + box.y + " " + box.width + " " + box.height);
 
     }