add default values for dimensions
This commit is contained in:
Vendored
+7
-1
@@ -1205,11 +1205,17 @@ function ImageEditor(canvasId, args) {
|
|||||||
hideRulers: 'Hide Ruler',
|
hideRulers: 'Hide Ruler',
|
||||||
showFullscreen: 'Fullscreen',
|
showFullscreen: 'Fullscreen',
|
||||||
exitFullscreen: 'Exit Fullscreen',
|
exitFullscreen: 'Exit Fullscreen',
|
||||||
|
},
|
||||||
|
// Default dimensions
|
||||||
|
dimensions: {
|
||||||
|
width: 800,
|
||||||
|
height: 600
|
||||||
}
|
}
|
||||||
}, args);
|
}, args);
|
||||||
|
|
||||||
|
|
||||||
// Initialize canvas
|
// 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
|
// 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.
|
||||||
|
|||||||
@@ -11,11 +11,9 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var width = document.getElementById('width');
|
var width = document.getElementById('width');
|
||||||
var height = document.getElementById('height');
|
var height = document.getElementById('height');
|
||||||
var dimensions = {width: 800, height: 600};
|
|
||||||
|
|
||||||
var editor = new ImageEditor('image-editor', {
|
var editor = new ImageEditor('image-editor', {
|
||||||
type: 'photo-wallpaper',
|
type: 'photo-wallpaper'
|
||||||
dimensions: dimensions
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function cropImage() {
|
function cropImage() {
|
||||||
@@ -27,7 +25,7 @@
|
|||||||
if(isFullscreen) {
|
if(isFullscreen) {
|
||||||
editor.canvas.resize({width: window.innerWidth, height: window.innerHeight});
|
editor.canvas.resize({width: window.innerWidth, height: window.innerHeight});
|
||||||
} else {
|
} 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',
|
hideRulers: 'Hide Ruler',
|
||||||
showFullscreen: 'Fullscreen',
|
showFullscreen: 'Fullscreen',
|
||||||
exitFullscreen: 'Exit Fullscreen',
|
exitFullscreen: 'Exit Fullscreen',
|
||||||
|
},
|
||||||
|
// Default dimensions
|
||||||
|
dimensions: {
|
||||||
|
width: 800,
|
||||||
|
height: 600
|
||||||
}
|
}
|
||||||
}, args);
|
}, args);
|
||||||
|
|
||||||
|
|
||||||
// Initialize canvas
|
// 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
|
// 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