Fix resize width and height to -1

This commit is contained in:
Hongarc 2019-04-25 11:29:10 +07:00
parent a44d05e265
commit ce516d9c9b

View file

@ -68,9 +68,7 @@ var Visualization = Backbone.View.extend({
this.myResize();
$(window).on('resize', function() {
this.myResize();
}.bind(this));
$(window).on('resize', () => this.myResize());
// If the visualization is within a draggable container, we need to update the
// position whenever the container is moved.
@ -257,12 +255,11 @@ var Visualization = Backbone.View.extend({
myResize: function() {
if (!this.paper) { return; }
var smaller = 1;
var el = this.el;
var elSize = el.getBoundingClientRect();
var width = elSize.width - smaller;
var height = elSize.height - smaller;
var width = elSize.width;
var height = elSize.height;
// if we don't have a container, we need to set our
// position absolutely to whatever we are tracking