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. * 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, { var Canvas = fabric.util.createClass(fabric.Canvas, {
initialize: function (id) { initialize: function (id, dimensions) {
this.callSuper('initialize', id, { this.callSuper('initialize', id, {
enableRetinaScaling: true, enableRetinaScaling: true,
renderOnAddRemove: false, renderOnAddRemove: false,
@@ -26,8 +26,8 @@ var Canvas = fabric.util.createClass(fabric.Canvas, {
backgroundColor: '#d2d2d2', backgroundColor: '#d2d2d2',
preserveObjectStacking: true, preserveObjectStacking: true,
selection: false, selection: false,
width: 1253, width: dimensions.width,
height: 600 height: dimensions.height
}); });
// Eventhandler for mouseup events on the whole canvas. // Eventhandler for mouseup events on the whole canvas.
+1 -1
View File
@@ -23,7 +23,7 @@ function ImageEditor(canvasId, args) {
}, args); }, args);
// Initialize canvas // 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 // Let Canvas know which type it is, canvas or wallpaper since it is
// accessible for all objects contained within. // accessible for all objects contained within.