P5-1471. Image should be centered when you open the page on ipad.

This commit is contained in:
EricaWind
2017-06-26 17:34:12 +03:00
parent e3e6019526
commit 1ffdf3b067
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ var $document = $(document);
* Fe. getDragbars method can be called from most places as the Canvas class is available in most places.
*/
var Canvas = fabric.util.createClass(fabric.Canvas, {
initialize: function (id) {
initialize: function (id, dimensions) {
this.callSuper('initialize', id, {
enableRetinaScaling: true,
renderOnAddRemove: false,
@@ -26,8 +26,8 @@ var Canvas = fabric.util.createClass(fabric.Canvas, {
backgroundColor: '#d2d2d2',
preserveObjectStacking: true,
selection: false,
width: 1253,
height: 600
width: dimensions.width,
height: dimensions.height
});
// Eventhandler for mouseup events on the whole canvas.
+1 -1
View File
@@ -23,7 +23,7 @@ function ImageEditor(canvasId, args) {
}, args);
// Initialize canvas
_canvas = new Canvas(canvasId);
_canvas = new Canvas(canvasId, args.dimensions);
// Let Canvas know which type it is, canvas or wallpaper since it is
// accessible for all objects contained within.