add default values for dimensions
This commit is contained in:
Vendored
+7
-1
@@ -1205,11 +1205,17 @@ function ImageEditor(canvasId, args) {
|
||||
hideRulers: 'Hide Ruler',
|
||||
showFullscreen: 'Fullscreen',
|
||||
exitFullscreen: 'Exit Fullscreen',
|
||||
},
|
||||
// Default dimensions
|
||||
dimensions: {
|
||||
width: 800,
|
||||
height: 600
|
||||
}
|
||||
}, args);
|
||||
|
||||
|
||||
// Initialize canvas
|
||||
_canvas = new Canvas(canvasId, args.dimensions);
|
||||
_canvas = new Canvas(canvasId, _settings.dimensions);
|
||||
|
||||
// Let Canvas know which type it is, canvas or wallpaper since it is
|
||||
// accessible for all objects contained within.
|
||||
|
||||
@@ -11,11 +11,9 @@
|
||||
<script type="text/javascript">
|
||||
var width = document.getElementById('width');
|
||||
var height = document.getElementById('height');
|
||||
var dimensions = {width: 800, height: 600};
|
||||
|
||||
var editor = new ImageEditor('image-editor', {
|
||||
type: 'photo-wallpaper',
|
||||
dimensions: dimensions
|
||||
type: 'photo-wallpaper'
|
||||
});
|
||||
|
||||
function cropImage() {
|
||||
@@ -27,7 +25,7 @@
|
||||
if(isFullscreen) {
|
||||
editor.canvas.resize({width: window.innerWidth, height: window.innerHeight});
|
||||
} else {
|
||||
editor.canvas.resize(dimensions);
|
||||
editor.canvas.resize({width: 800, height: 600});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -19,11 +19,17 @@ function ImageEditor(canvasId, args) {
|
||||
hideRulers: 'Hide Ruler',
|
||||
showFullscreen: 'Fullscreen',
|
||||
exitFullscreen: 'Exit Fullscreen',
|
||||
},
|
||||
// Default dimensions
|
||||
dimensions: {
|
||||
width: 800,
|
||||
height: 600
|
||||
}
|
||||
}, args);
|
||||
|
||||
|
||||
// Initialize canvas
|
||||
_canvas = new Canvas(canvasId, args.dimensions);
|
||||
_canvas = new Canvas(canvasId, _settings.dimensions);
|
||||
|
||||
// Let Canvas know which type it is, canvas or wallpaper since it is
|
||||
// accessible for all objects contained within.
|
||||
|
||||
Reference in New Issue
Block a user