Refactor properties into methods for canvas
This commit is contained in:
@@ -29,13 +29,13 @@ function Viewport(canvas) {
|
||||
_rect.height += _borderWidth;
|
||||
_rect.addTo(canvas).center().setCoords();
|
||||
|
||||
canvas.image
|
||||
canvas.getImage()
|
||||
.center()
|
||||
.drag.enable(calcMinMaxBoundsForRect(_rect.getInsideBoundingRect(), canvas.image));
|
||||
canvas.aperture.apply(_data.axis, _rect.getBoundingRect());
|
||||
.drag.enable(calcMinMaxBoundsForRect(_rect.getInsideBoundingRect(), canvas.getImage()));
|
||||
canvas.getApertures().apply(_data.axis, _rect.getBoundingRect());
|
||||
|
||||
drawBeams();
|
||||
canvas.dragbars.apply();
|
||||
canvas.getDragbars().apply();
|
||||
|
||||
// Apertures sometimes overlaps the viewports bounding rect.
|
||||
// Solve this by bringing it to the front after apertures are applied.
|
||||
@@ -115,13 +115,13 @@ function Viewport(canvas) {
|
||||
* @return {Viewport}
|
||||
*/
|
||||
this.set = function (width, height) {
|
||||
_data = util.calcCrop(canvas.image, width, height);
|
||||
_data = util.calcCrop(canvas.getImage(), width, height);
|
||||
apply();
|
||||
this.gores.reset();
|
||||
this.rulers.reset();
|
||||
canvas.aperture.setTransparent(true);
|
||||
canvas.image.__moved = false;
|
||||
canvas.buttonMenu.bringToFront();
|
||||
canvas.getApertures().setTransparent(true);
|
||||
canvas.getImage().__moved = false;
|
||||
canvas.getButtonMenu().bringToFront();
|
||||
};
|
||||
|
||||
util.setProperties(this, {
|
||||
|
||||
Reference in New Issue
Block a user