Begin implement canvas editor
This commit is contained in:
@@ -12,6 +12,11 @@ function ImageEditor(canvasId, args) {
|
|||||||
|
|
||||||
// Initialize canvas
|
// Initialize canvas
|
||||||
_canvas = new Canvas(canvasId);
|
_canvas = new Canvas(canvasId);
|
||||||
|
// Let Canvas know which type it is, canvas or wallpaper since it is
|
||||||
|
// accessible for all objects contained within.
|
||||||
|
_canvas.set({
|
||||||
|
__type: _settings.type
|
||||||
|
});
|
||||||
|
|
||||||
_canvas.getButtonMenu()
|
_canvas.getButtonMenu()
|
||||||
.addItem(['Show Murals Panel', 'Hide Murals Panel'], function () {
|
.addItem(['Show Murals Panel', 'Hide Murals Panel'], function () {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ function Viewport(canvas) {
|
|||||||
width: _data.width,
|
width: _data.width,
|
||||||
height: _data.height,
|
height: _data.height,
|
||||||
stroke: '#fff',
|
stroke: '#fff',
|
||||||
strokeWidth: _borderWidth,
|
strokeWidth: canvas.__type === 'canvas' ? 0 : _borderWidth
|
||||||
});
|
});
|
||||||
|
|
||||||
_rect.width += _borderWidth;
|
_rect.width += _borderWidth;
|
||||||
@@ -34,7 +34,12 @@ function Viewport(canvas) {
|
|||||||
.drag.enable(calcMinMaxBoundsForRect(_rect.getInsideBoundingRect(), canvas.getImage()));
|
.drag.enable(calcMinMaxBoundsForRect(_rect.getInsideBoundingRect(), canvas.getImage()));
|
||||||
canvas.getApertures().apply(_data.axis, _rect.getBoundingRect());
|
canvas.getApertures().apply(_data.axis, _rect.getBoundingRect());
|
||||||
|
|
||||||
|
if (canvas.__type !== 'canvas') {
|
||||||
drawBeams();
|
drawBeams();
|
||||||
|
} else {
|
||||||
|
// drawFrames
|
||||||
|
}
|
||||||
|
|
||||||
canvas.getDragbars().apply();
|
canvas.getDragbars().apply();
|
||||||
|
|
||||||
// Apertures sometimes overlaps the viewports bounding rect.
|
// Apertures sometimes overlaps the viewports bounding rect.
|
||||||
|
|||||||
Reference in New Issue
Block a user