geek
geek

Reputation: 816

Get the width/height of paper using JointJS

I resize the paper size by moving model :

paper.on('cell:pointermove', 
function(cellView, evt, x, y) { 
    if((x+cellView.model.prop('size/width'))>=650 &&(y+cellView.model.prop('size/height'))>=200)
    paper.setDimensions(x+cellView.model.prop('size/width'), y+cellView.model.prop('size/height'));
}

Is there any way I can change the property of paper just like element.prop(properties)?

Upvotes: 1

Views: 3234

Answers (2)

Kris Jobs
Kris Jobs

Reputation: 738

Why don't you just call paper.fitToContent()?

Upvotes: 0

dave
dave

Reputation: 4403

You can get the width/height of the paper with paper.options.width and paper.options.height. Paper is a view, not a model so it does not have set()/get()/prop()/attr() methods but you can always store properties to it just like to any other object if you want: paper.foo = 'bar'

Upvotes: 4

Related Questions