Begin implement canvas editor

This commit is contained in:
Rikard Bartholf
2017-05-15 15:32:56 +02:00
parent 75796fbbf1
commit 4617f9f92d
2 changed files with 12 additions and 2 deletions
@@ -12,6 +12,11 @@ function ImageEditor(canvasId, args) {
// Initialize canvas
_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()
.addItem(['Show Murals Panel', 'Hide Murals Panel'], function () {
+7 -2
View File
@@ -22,7 +22,7 @@ function Viewport(canvas) {
width: _data.width,
height: _data.height,
stroke: '#fff',
strokeWidth: _borderWidth,
strokeWidth: canvas.__type === 'canvas' ? 0 : _borderWidth
});
_rect.width += _borderWidth;
@@ -34,7 +34,12 @@ function Viewport(canvas) {
.drag.enable(calcMinMaxBoundsForRect(_rect.getInsideBoundingRect(), canvas.getImage()));
canvas.getApertures().apply(_data.axis, _rect.getBoundingRect());
drawBeams();
if (canvas.__type !== 'canvas') {
drawBeams();
} else {
// drawFrames
}
canvas.getDragbars().apply();
// Apertures sometimes overlaps the viewports bounding rect.