328 break; |
328 break; |
329 } |
329 } |
330 }); |
330 }); |
331 |
331 |
332 this.renkan.project.on("loaded", function(){ |
332 this.renkan.project.on("loaded", function(){ |
333 Backbone.history.start(); |
333 if (_this.renkan.options.url_parameters){ |
|
334 Backbone.history.start(); |
|
335 } else { |
|
336 _this.fixSize(); |
|
337 } |
334 _this.redrawActive = true; |
338 _this.redrawActive = true; |
335 _thRedraw(); |
339 _thRedraw(); |
336 }); |
340 }); |
337 |
341 |
338 this.renkan.project.on("change:loadingStatus", function(){ |
342 this.renkan.project.on("change:loadingStatus", function(){ |
488 }; |
492 }; |
489 |
493 |
490 _(Scene.prototype).extend({ |
494 _(Scene.prototype).extend({ |
491 fixSize: function() { |
495 fixSize: function() { |
492 if(typeof this.view === 'undefined') { |
496 if(typeof this.view === 'undefined') { |
493 this.view = this.addRepresentation("View", this.renkan.project.get("views").last()); |
497 this.view = this.addRepresentation("View", this.renkan.project.get("views").first()); |
494 this.view.setScale(view.get("zoom_level"), new paper.Point(view.get("offset"))); |
498 } |
495 } |
499 this.view.autoScale(); |
496 else{ |
|
497 this.view.autoScale(); |
|
498 } |
|
499 }, |
500 }, |
500 drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) { |
501 drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) { |
501 var _options = this.renkan.options, |
502 var _options = this.renkan.options, |
502 _startRads = _startAngle * Math.PI / 180, |
503 _startRads = _startAngle * Math.PI / 180, |
503 _endRads = _endAngle * Math.PI / 180, |
504 _endRads = _endAngle * Math.PI / 180, |
1230 if (this.view){ |
1231 if (this.view){ |
1231 this.view.setScale(params.zoom_level, new paper.Point(params.offset)); |
1232 this.view.setScale(params.zoom_level, new paper.Point(params.offset)); |
1232 } else{ |
1233 } else{ |
1233 this.view = this.addRepresentation("View", null); |
1234 this.view = this.addRepresentation("View", null); |
1234 this.view.params = params; |
1235 this.view.params = params; |
1235 this.view.init(); |
1236 this.view.initWithParams(); |
1236 } |
1237 } |
1237 } |
1238 } |
1238 if (!this.view){ |
1239 if (!this.view){ |
1239 this.view = this.addRepresentation("View", this.renkan.project.get("views").at(this.validViewIndex(this.renkan.options.default_index_view))); |
1240 this.view = this.addRepresentation("View", this.renkan.project.get("views").at(this.validViewIndex(this.renkan.options.default_index_view))); |
1240 this.view.autoScale(); |
1241 this.view.autoScale(); |