P5-1471. Image should be centered when you open the page on ipad.
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user