Objective
In a Fixed space of a particular dimension say 500px X 350px.
I want the PaperJS diagram to fit such that the everything fits well by scaling itself.
var scope = new paper.PaperScope();
var canvas_1 = document.getElementById('canvas_1');
scope.setup(canvas_1)
scope.activate();
var myCircle = new scope.Path.Circle(new scope.Point(100, 70), 50);
myCircle.fillColor = 'black';
var myCircle = new scope.Path.Circle(new scope.Point(10, 10), 50);
myCircle.fillColor = 'green';
var myCircle = new scope.Path.Circle(new scope.Point(200, 200), 50);
myCircle.fillColor = 'yellow';
$(document).ready(function()
{
$("#zoom_to_fit").click(function()
{
scope.project.activeLayer.fitBounds(scope.view.bounds);
})
});
Leave a Reply
You must be logged in to post a comment.