summaryrefslogtreecommitdiff
path: root/js/lib/snapmx.js
blob: 4deb7299658ffbe03b2e7f4220f3e8c4a31fc12e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var SnapMX = (function(){

  function SnapMX (w, h) {
    w = w || 100
    h = h || 100
    var snap = this.snap = new Snap (w, h)
    var el = this.el = snap.node
    var mx = this.mx = new MX.Object3D (el)
    scene.add(mx)
  }
  SnapMX.prototype.resize = function(w, h){
    this.snap.attr({
      width: w,
      height: h|0,
    })
    this.mx.width = w
    this.mx.height = h
  }
  SnapMX.prototype.clear = function(){
    this.snap.clear()
  }
  SnapMX.prototype.show = function(){
    this.visible = true
    this.mx.style.display = "block"
  }
  SnapMX.prototype.hide = function(){
    this.visible = false
    this.mx.style.display = "hide"
  }

  return SnapMX

})()