summaryrefslogtreecommitdiffstats
path: root/src/bbox.js
blob: c67d7c2c07678de51e5c9e67ed5ff5edfa0c89ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
SVG.BBox = function(element) {
  /* actual, native bounding box */
  var box = element.node.getBBox()
  
  /* include translations on x an y */
  this.x = box.x + element.trans.x
  this.y = box.y + element.trans.y
  
  /* add the center */
  this.cx = this.x + box.width / 2
  this.cy = this.x + box.height / 2
  
  /* plain width and height */
  this.width  = box.width
  this.height = box.height
  
}