Added simple resize function to canvas. Needs to be fixed with positioning of other elements

This commit is contained in:
Erik Tiekstra
2017-05-19 07:41:20 +02:00
parent eb6ff91aff
commit 7817b35a50
3 changed files with 18 additions and 10 deletions
+10
View File
@@ -2,6 +2,9 @@
(function() {
var $document = $(document);
var $window = $(window);
var $wrapper = $('#wrapper');
// Inputs for the editor
var $input = {
w: $('#form-control input[name="w"]'),
@@ -62,6 +65,11 @@
},
SetBorder: function () {
editor.canvas.getViewport().setFrame($(this).val());
},
handleResize: function() {
var width = $wrapper.width();
var height = $wrapper.height();
editor.canvas.resize({width: width, height: height});
}
};
@@ -80,4 +88,6 @@
.on('PIE:dragbar-click', function(e, data) {
console.log('Clicked on a dragbar! Axis: ' + data.axis);
});
$window.on('resize', Event.handleResize);
}());